sebastian-software/core

View on GitHub

Showing 406 of 406 total issues

Avoid deeply nested control flow statements.
Open

            if (source.charAt(Index) == '"') {
              Index++;
              // Return the revived string.
              return value;
            }
Severity: Major
Found in source/class/core/JSON.js - About 45 mins to fix

    Function _section has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

                _section: function(key, method, data, partials, labels, section)
    Severity: Minor
    Found in source/class/core/template/Template.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                  if (symbol >= "0" && symbol <= "9") {
                    // Leading zeroes are interpreted as octal literals.
                    if (symbol == "0" && (symbol = source.charAt(Index + 1), symbol >= "0" && symbol <= "9")) {
                      // Illegal octal literal.
                      abort();
      Severity: Major
      Found in source/class/core/JSON.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    for (index = 0, length = filter.length; index < length; value = filter[index++], ((getClass.call(value) == "[object String]" || getClass.call(value) == "[object Number]") && (properties[value] = 1)));
        Severity: Major
        Found in source/class/core/JSON.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if (typeof resolved == "string") {
                                  code += walk(core.template.Parser.parse(resolved, true), labels);
                              } else {
                                  code += 'buf+=this._label("' + escaped + '",data,partials,labels);';
                              }
          Severity: Major
          Found in source/class/core/template/Compiler.js - About 45 mins to fix

            Function detect has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              detect : function()
              {
                return new core.event.Promise(function(resolve, reject) {
                  if (navigator.geolocation)
                  {
            Severity: Minor
            Found in source/class/core/service/location/GPS.js - 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

                      } else if (getClass.call(width) == "[object String]") {
                        whitespace = width.length <= 10 ? width : width.slice(0, 10);
                      }
            Severity: Major
            Found in source/class/core/JSON.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  else if (core.Interface.isInterface(type))
                                  {
                                      core.Interface.assert(value, type);
                                  }
                                  else
              Severity: Major
              Found in source/class/core/property/Debug.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            } else if (scrollTop > maxScrollTop) {
                
                              scrollTop = maxScrollTop;
                
                            } else {
                Severity: Major
                Found in source/class/core/ui/Scroller.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              if ((width -= width % 1) > 0) {
                                for (whitespace = "", width > 10 && (width = 10); whitespace.length < width; whitespace += " ");
                              }
                  Severity: Major
                  Found in source/class/core/JSON.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                              } else if (value == "{") {
                                // Parses a JSON object, returning a new JavaScript object.
                                results = {};
                                for (;; any || (any = true)) {
                                  value = lex();
                    Severity: Major
                    Found in source/class/core/JSON.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                  if (stack[length] === value) {
                                    // Cyclic structures cannot be serialized by `JSON.stringify`.
                                    throw TypeError();
                                  }
                      Severity: Major
                      Found in source/class/core/JSON.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                    for (;; any || (any = true)) {
                                      value = lex();
                                      // A closing square bracket marks the end of the array literal.
                                      if (value == "]") {
                                        break;
                        Severity: Major
                        Found in source/class/core/JSON.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      if (raise) {
                                                          throw new Error("Property " + name + " in " + this + " is not valid!");
                                                      } else {
                                                          return false;
                                                      }
                          Severity: Major
                          Found in source/class/core/property/MGeneric.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if (key in members && members[key] instanceof Function && includedClass.prototype[key] instanceof Function && allIncludeMembers[key] instanceof Function) {
                                                        // pass
                                                    } else {
                                                        throw new Error("Included class " + includedClass.className + " overwrites member " + key + " of other included class " + allIncludeMembers[key].className + " in class " + name);
                                                    }
                            Severity: Major
                            Found in source/class/core/Class.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                          for (value = "@", Index++; Index < length;) {
                                            symbol = source.charAt(Index);
                                            if (symbol < " ") {
                                              // Unescaped ASCII control characters are not permitted.
                                              abort();
                              Severity: Major
                              Found in source/class/core/JSON.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                            if (href.charAt(0) === '#') {
                                                                this.open(href.slice(1));
                                                            } else {
                                                                return;
                                                            }
                                Severity: Major
                                Found in source/class/core/apibrowser/Browser.js - About 45 mins to fix

                                  Function cmn has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      var cmn = function(q, a, b, x, s, t) {
                                  Severity: Minor
                                  Found in source/class/core/crypt/MD5.js - About 45 mins to fix

                                    Function __showTree has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                            __showTree: function(data) {
                                    
                                                if (!data.file) {
                                                    return;
                                                }
                                    Severity: Minor
                                    Found in source/class/core/apibrowser/Browser.js - 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 (!(cMember instanceof Function)) {
                                                                    throw new Error(commonErrMsg + "Different member types in: " + name + "! Expecting a function!");
                                                                } else if (!removedUnusedArgs && iMember.length != cMember.length) {
                                                                    throw new Error(commonErrMsg + "Different number of arguments in function '" + name + "'. Expecting " + iMember.length + "!");
                                                                }
                                    Severity: Major
                                    Found in source/class/core/Interface.js - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language