codenothing/Nlint

View on GitHub

Showing 22 of 26 total issues

File Nlint.js has 341 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var fs = require( 'fs' ),
    async = require( 'async' ),
    JSON5 = require( 'json5' ),
    child_process = require( 'child_process' ),
    rstartslash = /^\//,
Severity: Minor
Found in lib/Nlint.js - About 4 hrs to fix

    Function update has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        update: function( settings, root ) {
            var self = this, list = [];
            root = root || process.cwd();
            settings = settings || {};
    
    
    Severity: Minor
    Found in lib/Settings.js - About 2 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 each has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        each: function( items, fn ) {
            var i, l;
    
            if ( Nlint.isNumber( items ) ) {
                for ( i = -1; ++i < items; ) {
    Severity: Minor
    Found in lib/Util.js - About 2 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 render has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        render: function( path, contents, settings, callback ) {
            var errors = [],
                checker = new JSCS(),
                results = [],
                lines = contents.trim().split( rnewline ),
    Severity: Major
    Found in lib/linters/jscs.js - About 2 hrs to fix

      Function update has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          update: function( settings, root ) {
              var self = this, list = [];
              root = root || process.cwd();
              settings = settings || {};
      
      
      Severity: Minor
      Found in lib/Settings.js - About 1 hr to fix

        Function Linter has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Linter( path ) {
            var self = this, result, settings,
                current = Nlint.Linters.filter(function( linter ) {
                    return linter.path === path;
                });
        Severity: Minor
        Found in lib/Linter.js - About 1 hr to fix

          Function extend has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          Nlint.extend = function(){
              var args = Slice.call( arguments ), i = -1, l = args.length, deep = false, target = this, name, copy;
          
              // Check for deep copy
              if ( Nlint.isBoolean( args[ 0 ] ) ) {
          Severity: Minor
          Found in lib/Util.js - About 1 hr 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 run has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              run: function( callback ) {
                  var self = this;
          
                  // Start processing each file
                  async.each(
          Severity: Minor
          Found in lib/Nlint.js - About 1 hr to fix

            Function Linter has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            function Linter( path ) {
                var self = this, result, settings,
                    current = Nlint.Linters.filter(function( linter ) {
                        return linter.path === path;
                    });
            Severity: Minor
            Found in lib/Linter.js - About 1 hr 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 _runLint has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _runLint: function( result, settings, linter, callback ){
                    var self = this,
            
                        // We have to create a copy of the options used for each linter in case
                        // the linter itself alters the options
            Severity: Minor
            Found in lib/Nlint.js - About 1 hr to fix

              Function finished has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  finished: function( e ) {
                      var self = this,
                          passed = false,
                          warn = false,
                          error = false;
              Severity: Minor
              Found in lib/Render.js - About 1 hr to fix

                Function forks has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    forks: function(){
                        var self = this;
                
                        if ( self._forks.length ) {
                            return;
                Severity: Minor
                Found in lib/Nlint.js - About 1 hr to fix

                  Function regexPath has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      regexPath: (function(){
                          var rdot = /\./g,
                              rstar = /\*/g,
                              rquot = /'/g,
                              rdquot = /"/g,
                  Severity: Minor
                  Found in lib/Util.js - About 1 hr to fix

                    Function _renderNodelint has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _renderNodelint: function( path, callback ) {
                            var self = this;
                    
                            // Read contents and store them
                            fs.stat( path, function( e, stat ) {
                    Severity: Minor
                    Found in lib/Nlint.js - About 1 hr to fix

                      Function Nlint has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function Nlint( files, options, callback ) {
                          var self = this;
                      
                          // Force Nlint instance
                          if ( ! ( self instanceof Nlint ) ) {
                      Severity: Minor
                      Found in lib/Nlint.js - About 1 hr to fix

                        Function passed has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            passed: function(){
                                var self = this;
                        
                                self.lint.results
                                    .sort(function( a, b ) {
                        Severity: Minor
                        Found in lib/Render.js - About 1 hr to fix

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

                              render: function( path, contents, settings, callback ) {
                                  var errors = [],
                                      checker = new JSCS(),
                                      results = [],
                                      lines = contents.trim().split( rnewline ),
                          Severity: Minor
                          Found in lib/linters/jscs.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

                          Function finished has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              finished: function( e ) {
                                  var self = this,
                                      passed = false,
                                      warn = false,
                                      error = false;
                          Severity: Minor
                          Found in lib/Render.js - 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

                          Function Nlint has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function Nlint( files, options, callback ) {
                              var self = this;
                          
                              // Force Nlint instance
                              if ( ! ( self instanceof Nlint ) ) {
                          Severity: Minor
                          Found in lib/Nlint.js - 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

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

                              _runLint: function( result, settings, linter, callback ){
                                  var self = this,
                          
                                      // We have to create a copy of the options used for each linter in case
                                      // the linter itself alters the options
                          Severity: Minor
                          Found in lib/Nlint.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