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

Fake pull-request to showcase the checks #174

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@
return;
}

var spotbug = combinations.size();

Check warning on line 120 in gama.core/src/gama/gaml/multi_criteria/MulticriteriaAnalyzeOperator.java

View workflow job for this annotation

GitHub Actions / SpotBugs

RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT

Return value of java.util.List.size() ignored, but method has no side effect
Raw output
This code calls a method and ignores the return value. However, our analysis shows that the method (including its implementations in subclasses if any) does not produce any effect other than return value. Thus, this call can be removed.

We are trying to reduce the false positives as much as possible, but in some cases this warning might be wrong. Common false-positive cases include:

- The method is designed to be overridden and produce a side effect in other projects which are out of the scope of the analysis.

- The method is called to trigger the class loading which may have a side effect.

- The method is called just to get some exception.

If you feel that our assumption is incorrect, you can use a @CheckReturnValue annotation to instruct SpotBugs that ignoring the return value of this method is acceptable.

for (int i = start; i <= end; i++) {
final Set<String> comb = new LinkedHashSet<>(currentSol);
comb.add(criteria.get(i));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ experiment "Tests for gama.extension.network" type: test skills:[network] {
}

write "network group Spice Girls -- done!";
assert (p1);
assert (p1) and false;
}

}
Loading