Showing 113 of 173 total issues

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

    private void lookAhead() {
        final Token current = this.getToken();
        final Token next = super.nextToken();
        if (next.getType() == EoParser.EOL
            && (current == null || current.getType() != EoParser.EOL)) {
Severity: Minor
Found in eo-parser/src/main/java/org/eolang/parser/EoIndentLexer.java - About 45 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 syntaxError has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        final Recognizer<?, ?> recognizer,
        final Object symbol,
        final int line,
        final int position,
        final String msg,
Severity: Minor
Found in eo-parser/src/main/java/org/eolang/parser/ParsingErrors.java - About 45 mins to fix

    Method buildChecked has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private void buildChecked(final Path cache) throws IOException {
            final File project = this.lib.resolve(this.name).toFile();
            final File cached = cache
                .resolve("Lib")
                .resolve(this.name)
    Severity: Minor
    Found in eo-maven-plugin/src/main/java/org/eolang/maven/rust/RustNode.java - About 45 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 deps has a Cognitive Complexity of 8 (exceeds 5 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 45 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

    Avoid deeply nested control flow statements.
    Open

                                if (idx < str.length() - 1 && str.charAt(idx + 1) >= '0'
                                    && str.charAt(idx + 1) <= '7') {
                                    code += str.charAt(idx + 1);
                                    ++idx;
                                }
    Severity: Major
    Found in eo-runtime/src/main/java/org/eolang/Data.java - About 45 mins to fix

      Method exec has a Cognitive Complexity of 8 (exceeds 5 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 45 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 8 (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/AssembleMojo.java - About 45 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 enterDeltaBinding has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public void enterDeltaBinding(final PhiParser.DeltaBindingContext ctx) {
              if (ctx.EMPTY() != null) {
                  if (!"org.eolang".equals(String.join(".", this.packages))
                      && !"bytes".equals(this.attributes.peek())
      Severity: Minor
      Found in eo-parser/src/main/java/org/eolang/parser/XePhiListener.java - About 35 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 numberOfLeadingZeros has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          private static byte numberOfLeadingZeros(final byte num) {
              final byte result;
              if (num == 0) {
                  result = (byte) Byte.SIZE;
              } else if (num < 0) {
      Severity: Minor
      Found in eo-runtime/src/main/java/org/eolang/BytesOf.java - About 35 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 keepThem has a Cognitive Complexity of 7 (exceeds 5 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 35 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 find has a Cognitive Complexity of 7 (exceeds 5 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 35 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 take has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public Phi take(final String name) {
              PhDefault.NESTING.set(PhDefault.NESTING.get() + 1);
              final Phi object;
              if (this.attrs.containsKey(name)) {
      Severity: Minor
      Found in eo-runtime/src/main/java/org/eolang/PhDefault.java - About 35 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 enterData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          @SuppressWarnings("PMD.ConfusingTernary")
          public void enterData(final EoParser.DataContext ctx) {
              final String type;
              final String data;
      Severity: Minor
      Found in eo-parser/src/main/java/org/eolang/parser/XeEoListener.java - About 35 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 copy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          @SuppressWarnings("PMD.AvoidAccessibilityAlteration")
          public Moja<T> copy(final Object mojo) {
              final Collection<String> mine = new ListOf<>(
                  new Mapped<>(
                      Field::getName,
      Severity: Minor
      Found in eo-maven-plugin/src/main/java/org/eolang/maven/Moja.java - About 35 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 sshift has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public Bytes sshift(final int bits) {
              if (bits < 0) {
                  throw new UnsupportedOperationException("right sshift is NYI");
              }
      Severity: Minor
      Found in eo-runtime/src/main/java/org/eolang/BytesOf.java - About 35 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 save has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public void save(final String program, final String ext, final Scalar<String> content)
              throws IOException {
              final String text;
              if (this.version.cacheable()) {
      Severity: Minor
      Found in eo-maven-plugin/src/main/java/org/eolang/maven/footprint/FtCached.java - About 35 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 asNumber has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public <T extends Number> T asNumber(final Class<T> type) {
              final byte[] ret = this.take();
              final Object res;
              final ByteBuffer buf = ByteBuffer.wrap(ret);
      Severity: Minor
      Found in eo-runtime/src/main/java/org/eolang/BytesOf.java - About 35 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 artifact has a Cognitive Complexity of 7 (exceeds 5 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()"

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

              private static String safeMessage(final Phi enclosure) {
                  String result;
                  if (enclosure == null) {
                      result = "null Phi";
                  } else {
      Severity: Minor
      Found in eo-runtime/src/main/java/EOorg/EOeolang/EOerror.java - About 35 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