Showing 111 of 171 total issues

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

    @Override
    public XML parsed() throws IOException {
        final XePhiListener xel = new XePhiListener(this.name);
        final ParsingErrors spy = new ParsingErrors(this.input);
        final PhiLexer lexer = new PhiLexer(
Severity: Minor
Found in eo-parser/src/main/java/org/eolang/parser/PhiSyntax.java - About 1 hr to fix

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

        @Override
        public void exec() throws IOException {
            final List<Path> all = new Walk(this.classesDir.toPath()).stream()
                .filter(
                    file -> this.includes.stream().anyMatch(
    Severity: Minor
    Found in eo-maven-plugin/src/main/java/org/eolang/maven/UnspileMojo.java - About 1 hr to fix

      Method run has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static void run(final List<String> opts) throws Exception {
              final String path = new JavaPath(opts.get(0)).toString();
              final Phi app;
              try {
                  Main.LOGGER.fine(String.format("Loading class %s...", path));
      Severity: Minor
      Found in eo-runtime/src/main/java/org/eolang/Main.java - About 1 hr to fix

        Method find has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @Override
            public int find(final String name) {
                if (name == null) {
                    throw new IllegalArgumentException(
                        "Argument name is null"
        Severity: Minor
        Found in eo-runtime/src/main/java/org/eolang/UniverseDefault.java - About 1 hr to fix

          Method accept has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              public void accept(final Path sources, final Path destination) {
                  final String src = sources.toString();
                  final String dst = destination.toString();
                  try {
          Severity: Minor
          Found in eo-maven-plugin/src/main/java/org/eolang/maven/CopiedResources.java - About 1 hr to fix

            Method exec has 28 lines of code (exceeds 25 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 1 hr to fix

              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

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language