Showing 118 of 209 total issues

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

    @Override
    public void accept(final Dependency dep, final Path path) {
        try {
            MojoExecutor.executeMojo(
                MojoExecutor.plugin(
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/Central.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 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 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()"

          Method shift has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              @SuppressWarnings("PMD.CognitiveComplexity")
              public Bytes shift(final int bits) {
                  // @checkstyle MethodBodyCommentsCheck (3 lines)
                  // @checkstyle NestedIfDepthCheck (40 lines)
          Severity: Minor
          Found in eo-runtime/src/main/java/org/eolang/BytesRaw.java - About 1 hr to fix

            Method deps has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private Collection<Dependency> deps() {
                    Iterable<Dependency> deps = new DcsDefault(
                        this.scopedTojos(),
                        this.discoverSelf,
                        this.skipZeroVersions
            Severity: Minor
            Found in eo-maven-plugin/src/main/java/org/eolang/maven/ResolveMojo.java - About 1 hr to fix

              Method transpile has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private int transpile(final ForeignTojo tojo) throws IOException {
                      final Path file;
                      try {
                          file = tojo.verified();
                      }  catch (final AttributeNotFoundException exception) {
              Severity: Minor
              Found in eo-maven-plugin/src/main/java/org/eolang/maven/TranspileMojo.java - About 1 hr to fix

                Method file has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private Path file(final Dependency origin) {
                        try {
                            final String name = DcsDepgraph.fileName(origin);
                            MojoExecutor.executeMojo(
                                MojoExecutor.plugin(

                  Method execWithTimeout has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @SuppressWarnings("PMD.CloseResource")
                      private void execWithTimeout() throws ExecutionException, TimeoutException {
                          final ExecutorService service = Executors.newSingleThreadExecutor();
                          try {
                              service.submit(
                  Severity: Minor
                  Found in eo-maven-plugin/src/main/java/org/eolang/maven/SafeMojo.java - About 1 hr to fix

                    Method exitError has 32 lines of code (exceeds 25 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

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

                          @Override
                          public Iterator<Dependency> iterator() {
                              final Collection<Dependency> deps = new ListOf<>(this.delegate.iterator());
                              final Map<String, Set<String>> conflicts = deps
                                  .stream()

                        Method probes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private Collection<ObjectName> probes(final Path file) throws FileNotFoundException {
                                final Collection<ObjectName> objects = new ListOf<>(
                                    new Mapped<>(
                                        obj -> new OnCached(
                                            new OnSwap(
                        Severity: Minor
                        Found in eo-maven-plugin/src/main/java/org/eolang/maven/ProbeMojo.java - About 1 hr to fix

                          Method parsed has 31 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 makeGraph has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private void makeGraph(final String xembly, final Path sodg) throws IOException {
                                    if (this.generateGraphFiles) {
                                        final Directives all = new Directives(xembly);
                                        Logger.debug(
                                            this, "There are %d Xembly directives for %s",
                            Severity: Minor
                            Found in eo-maven-plugin/src/main/java/org/eolang/maven/SodgMojo.java - About 1 hr to fix

                              Method φTerm has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  @Override
                                  public String φTerm() {
                                      final List<String> list = new ArrayList<>(this.attrs.size());
                                      final String format = "%s ↦ %s";
                                      if (this.data.get() != null) {
                              Severity: Minor
                              Found in eo-runtime/src/main/java/org/eolang/PhDefault.java - About 1 hr to fix

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

                                    @Override
                                    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/VerifyMojo.java - About 1 hr to fix

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

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

                                        @SuppressWarnings("unchecked")
                                        private static ConcurrentHashMap<String, String> load(final Path src) throws IOException {
                                            try (ObjectInputStream map = new ObjectInputStream(
                                                new ByteArrayInputStream(
                                                    Base64.getDecoder().decode(
                                    Severity: Minor
                                    Found in eo-maven-plugin/src/main/java/org/eolang/maven/rust/Names.java - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language