Showing 173 of 173 total issues

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public PhWith(final Phi phi, final int pos, final Phi attr) {
        super(
            () -> {
                phi.put(pos, attr);
                return phi;
Severity: Major
Found in eo-runtime/src/main/java/org/eolang/PhWith.java and 1 other location - About 1 hr to fix
eo-runtime/src/main/java/org/eolang/PhWith.java on lines 42..75

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 124.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public PhWith(final Phi phi, final String name, final Phi attr) {
        super(
            () -> {
                phi.put(name, attr);
                return phi;
Severity: Major
Found in eo-runtime/src/main/java/org/eolang/PhWith.java and 1 other location - About 1 hr to fix
eo-runtime/src/main/java/org/eolang/PhWith.java on lines 84..117

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 124.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    @Override
    void exec() {
        final Collection<ForeignTojo> tojos = this.scopedTojos().withOptimized();
        final int total = new OptimizedTojos(
            new Filtered<>(
eo-maven-plugin/src/main/java/org/eolang/maven/OptimizeMojo.java on lines 89..117

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 121.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    @Override
    public void exec() {
        final Collection<ForeignTojo> tojos = this.scopedTojos().withXmir();
        final int total = new OptimizedTojos(
            new Filtered<>(
eo-maven-plugin/src/main/java/org/eolang/maven/ShakeMojo.java on lines 86..114

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 121.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method validateComment has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void validateComment(
        final ParserRuleContext ctx,
        final List<EoParser.CommentContext> comments
    ) {
        if(this.tests || comments.isEmpty()) {
Severity: Minor
Found in eo-parser/src/main/java/org/eolang/parser/XeEoListener.java - About 1 hr to fix

    Method exec has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Override
        public void exec() {
            final List<Path> errors = new ListOf<>();
            final Home home = new HmBase(this.unphiOutputDir);
            final Iterable<Directive> metas = new UnphiMojo.Metas(this.unphiMetas);
    Severity: Minor
    Found in eo-maven-plugin/src/main/java/org/eolang/maven/UnphiMojo.java - About 1 hr to fix

      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 execute has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @Override
            @SuppressWarnings("PMD.CognitiveComplexity")
            public final void execute() throws MojoFailureException {
                StaticLoggerBinder.getSingleton().setMavenLog(this.getLog());
                if (this.skip) {
        Severity: Minor
        Found in eo-maven-plugin/src/main/java/org/eolang/maven/SafeMojo.java - About 1 hr to fix

          Method exitError has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              private void exitError(final String msg, final Throwable exp)
                  throws MojoFailureException {
                  if (!this.unrollExitError) {
                      return;
                  }
          Severity: Minor
          Found in eo-maven-plugin/src/main/java/org/eolang/maven/SafeMojo.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 exec has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              @Override
              public void exec() throws IOException {
                  if (this.generateGraphFiles && !this.generateXemblyFiles) {
                      throw new IllegalStateException(
                          "Setting generateGraphFiles and not setting generateXemblyFiles has no effect because .graph files require .xe files"
          Severity: Minor
          Found in eo-maven-plugin/src/main/java/org/eolang/maven/SodgMojo.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 exec has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              public void exec() {
                  if (this.sourcesDir == null) {
                      throw new IllegalArgumentException(
                          String.format("sourcesDir is null. Please specify a valid sourcesDir for %s", this)
          Severity: Minor
          Found in eo-maven-plugin/src/main/java/org/eolang/maven/RegisterMojo.java - About 1 hr to fix

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                    this.dirs.add("program")
                        .attr("name", this.name)
                        .attr("version", Manifests.read("EO-Version"))
                        .attr("revision", Manifests.read("EO-Revision"))
                        .attr("dob", Manifests.read("EO-Dob"))
            eo-parser/src/main/java/org/eolang/parser/XeEoListener.java on lines 127..143

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 108.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                    this.dirs.add("program")
                        .attr("name", this.name)
                        .attr("version", Manifests.read("EO-Version"))
                        .attr("revision", Manifests.read("EO-Revision"))
                        .attr("dob", Manifests.read("EO-Dob"))
            Severity: Major
            Found in eo-parser/src/main/java/org/eolang/parser/XeEoListener.java and 1 other location - About 1 hr to fix
            eo-parser/src/main/java/org/eolang/parser/XePhiListener.java on lines 122..136

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 108.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Method exec has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @Override
                public void exec() {
                    if (this.central == null) {
                        this.central = new Central(this.project, this.session, this.manager);
                    }
            Severity: Minor
            Found in eo-maven-plugin/src/main/java/org/eolang/maven/ResolveMojo.java - About 1 hr to fix

              Method iterator has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @Override
                  public Iterator<Dependency> iterator() {
                      final Collection<ForeignTojo> list = this.tojos.dependencies();
                      Logger.debug(
                          this, "%d suitable tojo(s) found out of %d",

                Method exec has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @Override
                    void exec() throws IOException {
                        final Home home = new HmBase(this.printOutputDir);
                        final int total = new SumOf(
                            new Threads<>(
                Severity: Minor
                Found in eo-maven-plugin/src/main/java/org/eolang/maven/PrintMojo.java - About 1 hr to fix

                  Method exec has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Override
                      public void exec() {
                          if (this.central == null) {
                              this.central = new Central(this.project, this.session, this.manager);
                          }
                  Severity: Minor
                  Found in eo-maven-plugin/src/main/java/org/eolang/maven/AssembleMojo.java - About 1 hr to fix

                    Method write has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        void write(final int identifier, final int offset, final byte[] data) {
                            synchronized (this.blocks) {
                                if (!this.blocks.containsKey(identifier)) {
                                    throw new ExFailure(
                                        String.format(
                    Severity: Minor
                    Found in eo-runtime/src/main/java/EOorg/EOeolang/Heaps.java - About 1 hr to fix

                      Method toPhi has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              private static Phi toPhi(final Object obj) {
                                  final Phi phi;
                                  final Phi eolang = Phi.Φ.take("org").take("eolang");
                                  if (obj instanceof Boolean) {
                                      if (obj.equals(true)) {
                      Severity: Minor
                      Found in eo-runtime/src/main/java/org/eolang/Data.java - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language