Showing 118 of 209 total issues

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

        @Override
        public String get() {
            final String result;
            switch (this.data.length) {
                case 0:
    Severity: Minor
    Found in eo-runtime/src/main/java/org/eolang/VerboseBytesAsString.java - About 1 hr to fix

      Method lambda has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @Override
          public Phi lambda() throws Exception {
              final String locator = this.take("code").locator().split(":")[0];
              final String name = Optional.ofNullable(NAMES.get(locator))
                  .orElseThrow(() -> new ExNative("No native function for %s", locator));
      Severity: Minor
      Found in eo-runtime/src/main/java/EOorg/EOeolang/EOrust.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 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 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 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 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 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 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 lambda has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @Override
                                public Phi lambda() throws Exception {
                                    final Path path = Paths.get(
                                        new Dataized(
                                            this.take(Attr.RHO).take("file").take("path")
                            Severity: Minor
                            Found in eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOdir$EOwalk.java - About 1 hr to fix

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

                                      @Override
                                      public Phi lambda() throws Exception {
                                          final Phi regex = this.take(Attr.RHO);
                                          final String expression = new Dataized(regex.take("expression")).asString();
                                          if (!expression.startsWith("/")) {

                                    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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language