-
Notifications
You must be signed in to change notification settings - Fork 78
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
Perhaps {0} could be replaced by a local variable. #420
Comments
|
Hi @rgfeldman I thought I'd start you on a gentle(ish) one but it does require a little judgement. The issue concerns class member variables that are only used by a single method. These might be better implemented as local variables in the individual methods. This isn't a beginners issue as it requires a little judgment but it's still a nice starter. There's not too many occurrences but I'd still suggest breaking the set up into multiple pull requests, one for each JHOVE module would seem sensible. Thanks for helping and good luck. |
|
jhove-apps/src/main/java/edu/harvard//hul/ois/jhove/viewer/InfoWindow.java There can be argument for keeping the definitions of the two JMenu class variables together (With _saveItem) in the class member variable. To Make _save Item local as well may be possible, but would be additional work. Not changing this for now The _base variable was not needed at all, it was sent in as a parameter to a member function |
|
Hi @rgfeldman feel free to use your skill and judgement, agree that not all will be best as local vars. |
|
few more comments about the analysis and work done: ########################################################## _bytesperentry moved to local area in code, where it is used and renamed without leading underscore |
There are 31 occurrences of this issue.
Why is this an issue?
Since: PMD 3.1
Fields whose scopes are limited to just single methods do not rely on the containing object to provide them to other methods. They may be better implemented as local variables within those methods.
Example(s):
A full list of occurrences can be found on Codacy here
The text was updated successfully, but these errors were encountered: