leap-protocol/leap-js

View on GitHub

Showing 61 of 64 total issues

Avoid too many return statements within this function.
Open

        return false;
Severity: Major
Found in src/configVerifier.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return value;
    Severity: Major
    Found in src/typeCodec.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        return "";
      Severity: Major
      Found in src/typeCodec.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return true;
        Severity: Major
        Found in src/configVerifier.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return to_padded_hex_string(value, 4);
          Severity: Major
          Found in src/typeCodec.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return value;
            Severity: Major
            Found in src/typeCodec.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return "";
              Severity: Major
              Found in src/typeCodec.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return value;
                Severity: Major
                Found in src/typeCodec.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return false;
                  Severity: Major
                  Found in src/configVerifier.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return str1 + to_padded_hex_string(value, 8);
                    Severity: Major
                    Found in src/typeCodec.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return "";
                      Severity: Major
                      Found in src/typeCodec.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return "";
                        Severity: Major
                        Found in src/typeCodec.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return (item == "1") ? (true) : (false);
                          Severity: Major
                          Found in src/typeCodec.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return decode_signed(item, 0x10000);
                            Severity: Major
                            Found in src/typeCodec.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                return count;
                              Severity: Major
                              Found in src/explore.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                  return null;
                                Severity: Major
                                Found in src/explore.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                    return null;
                                  Severity: Major
                                  Found in src/typeCodec.js - About 30 mins to fix

                                    Function verify has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      verify(config) {
                                        this._reset();
                                    
                                        if (config.length == 0) {
                                          this.section = "Config";
                                    Severity: Minor
                                    Found in src/configVerifier.js - About 25 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

                                    Function decode_signed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function decode_signed(item, capacity) {
                                      let reHex = /^[\dA-Fa-f]{1,}$/;
                                    
                                      if (reHex.test(item) == true) {
                                        let value = parseInt(item, 16);
                                    Severity: Minor
                                    Found in src/typeCodec.js - About 25 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

                                    Function _decode_subpacket has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      _decode_subpacket(subpacket) {
                                        const parts = subpacket.split(this._config["separator"]);
                                    
                                        if (parts != ['']) {
                                          const payload = [];
                                    Severity: Minor
                                    Found in src/codec.js - About 25 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