eo-maven-plugin/src/main/java/org/eolang/maven/UnplaceMojo.java

Summary

Maintainability
B
6 hrs
Test Coverage

Method killThem has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
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();
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/UnplaceMojo.java - About 1 hr to fix

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

    @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();
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/UnplaceMojo.java - About 1 hr to fix

    Method keepThem has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    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) {
    Severity: Minor
    Found in eo-maven-plugin/src/main/java/org/eolang/maven/UnplaceMojo.java - About 1 hr to fix

      Method unplaceClasses has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @SuppressWarnings("PMD.AvoidAccessToStaticMembersViaThis")
          private void unplaceClasses() throws IOException {
              final Collection<PlacedTojo> classes = this.placedTojos.classes();
              int deleted = 0;
              if (!this.keepBinaries.isEmpty()) {
      Severity: Minor
      Found in eo-maven-plugin/src/main/java/org/eolang/maven/UnplaceMojo.java - About 1 hr to fix

        Method keepThem has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        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) {
        Severity: Minor
        Found in eo-maven-plugin/src/main/java/org/eolang/maven/UnplaceMojo.java - About 35 mins to fix

        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

        There are no issues that match your filters.

        Category
        Status