Showing 113 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

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

            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

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

                                @Override
                                public Iterator<Dependency> iterator() {
                                    try {
                                        final Collection<Dependency> all = new ArrayList<>(0);
                                        if (Files.exists(this.file)) {

                          Method exec has a Cognitive Complexity of 12 (exceeds 5 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

                          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 validateComment has a Cognitive Complexity of 12 (exceeds 5 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

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

                              private int render(final Path xmir, final Path sodg) throws IOException {
                                  final XML before = new XMLDocument(xmir);
                                  if (Logger.isTraceEnabled(this)) {
                                      Logger.trace(this, "XML before translating to SODG:\n%s", before);
                                  }
                          Severity: Minor
                          Found in eo-maven-plugin/src/main/java/org/eolang/maven/SodgMojo.java - About 1 hr to fix

                            Method generate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @Override
                                public void generate() throws IOException {
                                    final String code = RustNode.unhex(this.node.xpath("@code").get(0));
                                    final List<String> dependencies =
                                        this.node.xpath("./dependencies/dependency/attribute(name)")
                            Severity: Minor
                            Found in eo-maven-plugin/src/main/java/org/eolang/maven/rust/RustNode.java - About 1 hr to fix

                              Method artifact has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private static Optional<Dependency> artifact(final Path file) {
                                      final Collection<String> coords;
                                      try {
                                          coords = new XMLDocument(file).xpath(
                                              "//meta[head='rt' and part[1]='jvm']/part[2]/text()"
                                Severity
                                Category
                                Status
                                Source
                                Language