Showing 118 of 209 total issues

Method take has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public <T> T take(final Class<T> type) {
        final Object res;
        if (type.equals(Long.class)) {
            res = new BytesOf(this.take()).asNumber(Long.class);
        } else if (type.equals(Double.class)) {
Severity: Minor
Found in eo-runtime/src/main/java/org/eolang/Dataized.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 asNumber has a Cognitive Complexity of 9 (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/BytesRaw.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() throws IOException {
        if (this.offline) {
            Logger.info(
                this,
Severity: Minor
Found in eo-maven-plugin/src/main/java/org/eolang/maven/PullMojo.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

Method enterMetas has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public void enterMetas(final EoParser.MetasContext ctx) {
        this.dirs.addIf("metas");
        for (final TerminalNode node : ctx.META()) {
            final String[] pair = node.getText().split(" ", 2);
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 CreateFile has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        String name,
        int access,
        int mode,
        SECURITY_ATTRIBUTES security,
        int disposition,
Severity: Major
Found in eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Win32/Kernel32.java - About 50 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 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 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

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

        @Override
        public Phi lambda() throws Exception {
            final Phi match = this.take(Attr.RHO);
            final InputStream bais = new ByteArrayInputStream(
                new Dataized(match.take(Attr.RHO).take("serialized")).take()

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

        @Override
        public Phi lambda() throws Exception {
            final String format = new Dataized(this.take("format")).asString();
            final Phi args = this.take("args");
            final Phi retriever = args.take("at");
    Severity: Minor
    Found in eo-runtime/src/main/java/EOorg/EOeolang/EOtxt/EOsprintf.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 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 WriteFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              HANDLE handle,
              byte[] buffer,
              int count,
              IntByReference written,
              OVERLAPPED overlapped
      Severity: Minor
      Found in eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Win32/Kernel32.java - About 35 mins to fix

        Method ReadFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                HANDLE handle,
                byte[] buffer,
                int count,
                IntByReference read,
                WinBase.OVERLAPPED overlapped
        Severity: Minor
        Found in eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Win32/Kernel32.java - About 35 mins to fix

          Method safeMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                  @SuppressWarnings("PMD.AvoidCatchingGenericException")
                  private static String safeMessage(final Phi enclosure) {
                      String result;
                      if (enclosure == null) {
                          result = "null Phi";
          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

          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/BytesRaw.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

          Severity
          Category
          Status
          Source
          Language