eo-maven-plugin/src/main/java/org/eolang/maven/UnplaceMojo.java
Method killThem
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
@SuppressWarnings("PMD.CognitiveComplexity")
private int killThem(final Iterable<PlacedTojo> all) throws IOException {
int unplaced = 0;
for (final PlacedTojo tojo : all) {
final String related = tojo.related();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method killThem
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@SuppressWarnings("PMD.CognitiveComplexity")
private int killThem(final Iterable<PlacedTojo> all) throws IOException {
int unplaced = 0;
for (final PlacedTojo tojo : all) {
final String related = tojo.related();
Method keepThem
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@SuppressWarnings("PMD.AvoidAccessToStaticMembersViaThis")
private int keepThem(final Iterable<? extends PlacedTojo> tojos) throws IOException {
int deleted = 0;
int remained = 0;
for (final PlacedTojo tojo : tojos) {
Method unplaceClasses
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@SuppressWarnings("PMD.AvoidAccessToStaticMembersViaThis")
private void unplaceClasses() throws IOException {
final Collection<PlacedTojo> classes = this.placedTojos.classes();
int deleted = 0;
if (!this.keepBinaries.isEmpty()) {
Method keepThem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
@SuppressWarnings("PMD.AvoidAccessToStaticMembersViaThis")
private int keepThem(final Iterable<? extends PlacedTojo> tojos) throws IOException {
int deleted = 0;
int remained = 0;
for (final PlacedTojo tojo : tojos) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"