mohayonao/SCScript

View on GitHub

Showing 245 of 1,712 total issues

File Float_test.js has 403 lines of code (exceeds 250 allowed). Consider refactoring.
Open

describe("Math/Float", function() {
  "use strict";

  var testCase = sc.test.testCase;
  var $$ = sc.test.object;
Severity: Minor
Found in src/sc/classlib/Math/Float_test.js - About 5 hrs to fix

    File series-expr_test.js has 373 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    describe("sc.lang.compiler.Parser", function() {
      "use strict";
    
      var Syntax = sc.lang.compiler.Syntax;
      var Token = sc.lang.compiler.Token;
    Severity: Minor
    Found in src/sc/lang/compiler/parser/series-expr_test.js - About 4 hrs to fix

      Function exports has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function(context) {
        "use strict";
      
        function getArgumentDefinition(list) {
          for (var i = 0, imax = list.length; i < imax; ++i) {
      Severity: Minor
      Found in tools/grunt-tasks/typo/args.js - About 4 hrs 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 generate has 119 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            function generate(node, options) {
              var defaultOptions = getDefaultOptions(), result, pair;
              if (options != null) {
                if (typeof options.indent === 'string') {
                  defaultOptions.format.indent.style = options.indent;
      Severity: Major
      Found in assets/escodegen.js - About 4 hrs to fix

        Function exports has 117 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(grunt) {
          "use strict";
        
          require("./tools/strlib");
        
        
        Severity: Major
        Found in Gruntfile.js - About 4 hrs to fix

          Function testCase has 91 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            sc.test.testCase = function(context, cases, opts) {
              opts = opts || {};
          
              var methodName    = context.test.title;
              var isClassMethod = methodName.charAt(0) === ".";
          Severity: Major
          Found in tools/test-utils.js - About 3 hrs to fix

            Function exports has 90 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function(grunt) {
              "use strict";
            
              var _ = require("underscore");
              var IMPLEMENTED     = true;
            Severity: Major
            Found in tools/grunt-tasks/impl.js - About 3 hrs to fix

              Function scanStringLiteral has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function scanStringLiteral() {
                      var str = '', quote, start, ch, code, unescaped, restore, octal = false;
              
                      quote = source[index];
                      assert((quote === '\'' || quote === '"'),
              Severity: Major
              Found in assets/esprima.js - About 3 hrs to fix

                Function sinonChai has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                }(function sinonChai(chai, utils) {
                    "use strict";
                
                    var slice = Array.prototype.slice;
                
                
                Severity: Major
                Found in assets/sinon-chai.js - About 3 hrs to fix

                  File rewriter_test.js has 309 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  describe("sc.lang.compiler.rewriter", function() {
                    "use strict";
                  
                    var Syntax = sc.lang.compiler.Syntax;
                    var Token = sc.lang.compiler.Token;
                  Severity: Minor
                  Found in src/sc/lang/compiler/rewriter/rewriter_test.js - About 3 hrs to fix

                    Function scanRegExp has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function scanRegExp() {
                            var str, ch, start, pattern, flags, value, classMarker = false, restore, terminated = false;
                    
                            lookahead = null;
                            skipComment();
                    Severity: Major
                    Found in assets/esprima.js - About 3 hrs to fix

                      Function exports has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      module.exports = function(grunt) {
                        "use strict";
                      
                        var path = require("path");
                        var Mocha = require("mocha");
                      Severity: Major
                      Found in tools/grunt-tasks/mocha.js - About 3 hrs to fix

                        File Function_test.js has 300 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        describe("Core/Function", function() {
                          "use strict";
                        
                          var testCase = sc.test.testCase;
                          var $$ = sc.test.object;
                        Severity: Minor
                        Found in src/sc/classlib/Core/Function_test.js - About 3 hrs to fix

                          File Integer.js has 300 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          SCScript.install(function(sc) {
                            "use strict";
                          
                            require("./SimpleNumber");
                          
                          
                          Severity: Minor
                          Found in src/sc/classlib/Math/Integer.js - About 3 hrs to fix

                            File mathlib.js has 299 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            (function(sc) {
                              "use strict";
                            
                              require("./libs");
                              require("./random");
                            Severity: Minor
                            Found in src/sc/libs/mathlib.js - About 3 hrs to fix

                              Function tokenize has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function tokenize(code, options) {
                                      var toString,
                                          token,
                                          tokens;
                              
                              
                              Severity: Major
                              Found in assets/esprima.js - About 3 hrs to fix

                                Function SourceNode_toStringWithSourceMap has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
                                        var generated = {
                                            code: '',
                                            line: 1,
                                            column: 0
                                Severity: Major
                                Found in assets/escodegen.js - About 3 hrs to fix

                                  Function attachComments has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        function attachComments(tree, providedComments, tokens) {
                                          var comments = [], comment, len, i, cursor;
                                          if (!tree.range) {
                                            throw new Error('attachComments needs range information');
                                          }
                                  Severity: Major
                                  Found in assets/escodegen.js - About 3 hrs to fix

                                    Function replace has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          Controller.prototype.replace = function replace(root, visitor) {
                                            var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key;
                                            this.__initialize(root, visitor);
                                            sentinel = {};
                                            worklist = this.__worklist;
                                    Severity: Major
                                    Found in assets/escodegen.js - About 2 hrs to fix

                                      Function parse has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          function parse(code, options) {
                                              var program, toString;
                                      
                                              toString = String;
                                              if (typeof code !== 'string' && !(code instanceof String)) {
                                      Severity: Major
                                      Found in assets/esprima.js - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language