Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions for common checks and actions #671

Open
Marcono1234 opened this issue May 28, 2021 · 1 comment
Open

Add functions for common checks and actions #671

Marcono1234 opened this issue May 28, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@Marcono1234
Copy link
Contributor

The Problem

Currently a lot of logic is duplicated between multiple modules, a noticeable example for this are checks for whether a comment has been written by staff or is staff restricted.
Additionally the checks are not consistent, some compare values case insensitively, others check for special values such as "Undefined".

Possible Solution

Every complex check which is performed by at least two modules, and every occurrence of String literals in two or more classes somehow related to Mojira should be refactored to common functions, reducing code duplication and making them more consistent.

This could be solved for example by adding functions such as:

  • Issue.hasModTag(String)
  • Comment.isStaffRestricted()
  • Comment.isWrittenByStaff()
  • ...

I have started doing some of the refactoring on a local branch, but I will likely not continue on that any time soon. Though if you want to have a look at it or continue based on that work I can push the branch.

@Marcono1234 Marcono1234 added the enhancement New feature or request label May 28, 2021
@urielsalis
Copy link
Member

Merging that into the major-refactor branch would be nice :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants