Showing 171 of 171 total issues

Method iterator has a Cognitive Complexity of 10 (exceeds 5 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",

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

        private String attr(final int pos) {
            if (0 > pos) {
                throw new ExFailure(
                    String.format(
                        "Attribute position can't be negative (%d)",
    Severity: Minor
    Found in eo-runtime/src/main/java/org/eolang/PhDefault.java - About 1 hr to fix

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

          private static ConcurrentHashMap<String, String> load(final String src) throws IOException {
              try (ObjectInputStream map = new ObjectInputStream(
                  new ByteArrayInputStream(
                      Base64.getDecoder().decode(
                          Files.readAllBytes(Paths.get(src))
      Severity: Minor
      Found in eo-runtime/src/main/java/EOorg/EOeolang/EOrust.java - About 1 hr to fix

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

            private static boolean parse(final String opt) throws IOException {
                if ("--verbose".equals(opt)) {
                    Main.EOLOG.setLevel(Level.FINE);
                    for (final Handler hnd : Main.EOLOG.getHandlers()) {
                        hnd.setLevel(Level.FINE);
        Severity: Minor
        Found in eo-runtime/src/main/java/org/eolang/Main.java - About 1 hr to fix

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

              public XML parsed() throws IOException {
                  final List<Text> lines = this.lines();
                  final ParsingErrors spy = new ParsingErrors(lines);
                  final EoLexer lexer = new EoIndentLexer(this.normalize());
                  lexer.removeErrorListeners();
          Severity: Minor
          Found in eo-parser/src/main/java/org/eolang/parser/EoSyntax.java - About 1 hr to fix

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

                @Override
                public Iterator<Dependency> iterator() {
                    return new Mapped<>(
                        dependency -> {
                            final Iterable<Dependency> transitives = new Filtered<>(

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

                  @Override
                  public void exec() {
                      final Collection<ForeignTojo> tojos = this.scopedTojos().withXmir();
                      final int total = new OptimizedTojos(
                          new Filtered<>(
              Severity: Minor
              Found in eo-maven-plugin/src/main/java/org/eolang/maven/OptimizeMojo.java - About 1 hr to fix

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

                    @Override
                    public void exec() throws IOException {
                        final Path target = this.outputDir.toPath().resolve(CopyMojo.DIR);
                        final Collection<Path> sources = new Walk(this.sourcesDir.toPath());
                        for (final Path src : sources) {
                Severity: Minor
                Found in eo-maven-plugin/src/main/java/org/eolang/maven/CopyMojo.java - About 1 hr to fix

                  Method take has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public <T> T take(final Class<T> type) {
                          final byte[] weak = this.take();
                          final Object strong;
                          if (type.equals(Long.class)) {
                              strong = new BytesOf(weak).asNumber(Long.class);
                  Severity: Minor
                  Found in eo-runtime/src/main/java/org/eolang/Dataized.java - About 1 hr to fix

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

                        @Override
                        void exec() {
                            final Collection<ForeignTojo> tojos = this.scopedTojos().withOptimized();
                            final int total = new OptimizedTojos(
                                new Filtered<>(
                    Severity: Minor
                    Found in eo-maven-plugin/src/main/java/org/eolang/maven/ShakeMojo.java - About 1 hr to fix

                      Method failures has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          @SuppressWarnings("unchecked")
                          public Collection<String> failures() throws IOException {
                              final Yaml yaml = new Yaml();
                              final Map<String, Object> map = yaml.load(this.script);
                              final String src = map.get("eo").toString();
                      Severity: Minor
                      Found in eo-parser/src/main/java/org/eolang/parser/CheckPack.java - About 55 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

                      Method enterBeginner has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          @Override
                          @SuppressWarnings("PMD.ConfusingTernary")
                          public void enterBeginner(final EoParser.BeginnerContext ctx) {
                              this.startObject(ctx);
                              if (ctx.data() == null) {
                      Severity: Minor
                      Found in eo-parser/src/main/java/org/eolang/parser/XeEoListener.java - About 55 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

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

                          @Override
                          public boolean put(final String name, final Phi object) {
                              System.out.printf("%d.put(\"%s\", %d)...\n", this.hashCode(), name, object.hashCode());
                              final boolean ret = this.origin.put(name, object);
                              System.out.printf("%d.put(\"%s\", %d)!\n", this.hashCode(), name, object.hashCode());
                      Severity: Minor
                      Found in eo-runtime/src/main/java/org/eolang/PhLogged.java and 1 other location - About 55 mins to fix
                      eo-runtime/src/main/java/org/eolang/PhLogged.java on lines 73..79

                      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 65.

                      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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          @Override
                          public void exec() {
                              final Collection<ForeignTojo> tojos = this.scopedTojos().notDiscovered();
                              final Collection<String> discovered = new HashSet<>();
                              for (final ForeignTojo tojo : tojos) {
                      Severity: Minor
                      Found in eo-maven-plugin/src/main/java/org/eolang/maven/DiscoverMojo.java - About 55 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

                      Method enterMetas has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          @Override
                          public void enterMetas(final EoParser.MetasContext ctx) {
                              this.dirs.addIf("metas");
                              for (final TerminalNode node : ctx.META()) {
                                  final String[] pair = node.getText().split(" ", 2);
                      Severity: Minor
                      Found in eo-parser/src/main/java/org/eolang/parser/XeEoListener.java - About 55 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

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

                          @Override
                          public boolean put(final int pos, final Phi object) {
                              System.out.printf("%d.put(%d, %d)...\n", this.hashCode(), pos, object.hashCode());
                              final boolean ret = this.origin.put(pos, object);
                              System.out.printf("%d.put(%d, %d)!\n", this.hashCode(), pos, object.hashCode());
                      Severity: Minor
                      Found in eo-runtime/src/main/java/org/eolang/PhLogged.java and 1 other location - About 55 mins to fix
                      eo-runtime/src/main/java/org/eolang/PhLogged.java on lines 81..87

                      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 65.

                      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

                      /*
                       * The MIT License (MIT)
                       *
                       * Copyright (c) 2016-2024 Objectionary.com
                       *
                      Severity: Minor
                      Found in eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOplus.java and 1 other location - About 50 mins to fix
                      eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOplus.java on lines 1..64

                      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 61.

                      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

                      /*
                       * The MIT License (MIT)
                       *
                       * Copyright (c) 2016-2024 Objectionary.com
                       *
                      Severity: Minor
                      Found in eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOplus.java and 1 other location - About 50 mins to fix
                      eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOplus.java on lines 1..64

                      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 61.

                      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 DcsDepgraph(
                              final MavenProject pkt,
                              final MavenSession ssn,
                              final BuildPluginManager mgr,
                              final Path path,
                      eo-maven-plugin/src/main/java/org/eolang/maven/rust/RustNode.java on lines 113..121

                      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 60.

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language