Showing 1,717 of 2,680 total issues

Function errorHandler has 232 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function errorHandler (er) {
  // console.error("errorHandler", er)
  if (!npm.config || !npm.config.loaded) {
    // logging won't work unless we pretend that it's ready
    er = er || new Error("Exit prior to config file resolving.")
Severity: Major
Found in deps/npm/lib/utils/error-handler.js - About 1 day to fix

    File util.js has 551 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Copyright Joyent, Inc. and other Node contributors.
    //
    // Permission is hereby granted, free of charge, to any person obtaining a
    // copy of this software and associated documentation files (the
    // "Software"), to deal in the Software without restriction, including
    Severity: Major
    Found in lib/util.js - About 1 day to fix

      Function masterInit has 228 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function masterInit() {
        cluster.workers = {};
      
        var intercom = new EventEmitter;
        cluster.settings = {};
      Severity: Major
      Found in lib/cluster.js - About 1 day to fix

        Consider simplifying this complex logical expression.
        Open

          if (code >= 0x1100 && (
              code <= 0x115f ||  // Hangul Jamo
              0x2329 === code || // LEFT-POINTING ANGLE BRACKET
              0x232a === code || // RIGHT-POINTING ANGLE BRACKET
              // CJK Radicals Supplement .. Enclosed CJK Letters and Months
        Severity: Critical
        Found in lib/readline.js - About 1 day to fix

          XcodeSettings has 62 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class XcodeSettings(object):
            """A class that understands the gyp 'xcode_settings' object."""
          
            # Populated lazily by _SdkPath(). Shared by all XcodeSettings, so cached
            # at class-level for efficiency.
          Severity: Major
          Found in tools/gyp/pylib/gyp/xcode_emulation.py - About 1 day to fix

            Function masterInit has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
            Open

            function masterInit() {
              cluster.workers = {};
            
              var intercom = new EventEmitter;
              cluster.settings = {};
            Severity: Minor
            Found in lib/cluster.js - About 1 day 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 __call__ has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
            Open

              def __call__(self, argv):
                """Parses flags from argv; stores parsed flags into this FlagValues object.
            
                All unparsed arguments are returned.  Flags are parsed using the GNU
                Program Argument Syntax Conventions, using getopt:
            Severity: Minor
            Found in tools/closure_linter/gflags.py - About 1 day 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 setupChannel has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
            Open

            function setupChannel(target, channel) {
              target._channel = channel;
              target._handleQueue = null;
            
              var decoder = new StringDecoder('utf8');
            Severity: Minor
            Found in lib/child_process.js - About 1 day 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

            File cluster.js has 519 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // Copyright Joyent, Inc. and other Node contributors.
            //
            // Permission is hereby granted, free of charge, to any person obtaining a
            // copy of this software and associated documentation files (the
            // "Software"), to deal in the Software without restriction, including
            Severity: Major
            Found in lib/cluster.js - About 1 day to fix

              File ecmalintrules.py has 518 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              #!/usr/bin/env python
              #
              # Copyright 2008 The Closure Linter Authors. All Rights Reserved.
              #
              # Licensed under the Apache License, Version 2.0 (the "License");
              Severity: Major
              Found in tools/closure_linter/closure_linter/ecmalintrules.py - About 1 day to fix

                Function createSecureContext has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                Open

                exports.createSecureContext = function createSecureContext(options, context) {
                  if (!options) options = {};
                
                  var secureOptions = options.secureOptions;
                  if (options.honorCipherOrder)
                Severity: Minor
                Found in lib/_tls_common.js - About 1 day 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 GenerateOutput has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                Open

                def GenerateOutput(target_list, target_dicts, data, params):
                  options = params['options']
                  flavor = gyp.common.GetFlavor(params)
                  generator_flags = params.get('generator_flags', {})
                  builddir_name = generator_flags.get('output_dir', 'out')
                Severity: Minor
                Found in tools/gyp/pylib/gyp/generator/make.py - About 1 day 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

                ScriptTest has 57 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class ScriptTest(unittest.TestCase):
                  def MakeEmptyTempFile(self):
                    handle, name = tempfile.mkstemp()
                    os.close(handle)
                    self._tmp_files.append(name)
                Severity: Major
                Found in deps/v8/tools/push-to-trunk/test_scripts.py - About 1 day to fix

                  File url.js has 504 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  // Copyright Joyent, Inc. and other Node contributors.
                  //
                  // Permission is hereby granted, free of charge, to any person obtaining a
                  // copy of this software and associated documentation files (the
                  // "Software"), to deal in the Software without restriction, including
                  Severity: Major
                  Found in lib/url.js - About 1 day to fix

                    Function Main has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def Main():
                      parser = BuildOptions()
                      (options, args) = parser.parse_args()
                      if not ProcessOptions(options):
                        parser.print_help()
                    Severity: Minor
                    Found in tools/test.py - About 1 day 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 complete has 200 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    REPLServer.prototype.complete = function(line, callback) {
                      // There may be local variables to evaluate, try a nested REPL
                      if (!util.isUndefined(this.bufferedCommand) && this.bufferedCommand.length) {
                        // Get a new array of inputed lines
                        var tmp = this.lines.slice();
                    Severity: Major
                    Found in lib/repl.js - About 1 day to fix

                      File crypto.js has 499 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      // Copyright Joyent, Inc. and other Node contributors.
                      //
                      // Permission is hereby granted, free of charge, to any person obtaining a
                      // copy of this software and associated documentation files (the
                      // "Software"), to deal in the Software without restriction, including
                      Severity: Minor
                      Found in lib/crypto.js - About 1 day to fix

                        Function resolveObject has 199 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        Url.prototype.resolveObject = function(relative) {
                          if (util.isString(relative)) {
                            var rel = new Url();
                            rel.parse(relative, false, true);
                            relative = rel;
                        Severity: Major
                        Found in lib/url.js - About 7 hrs to fix

                          Function _ttyWrite has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                          Open

                          Interface.prototype._ttyWrite = function(s, key) {
                            key = key || {};
                          
                            // Ignore escape key - Fixes #2876
                            if (key.name == 'escape') return;
                          Severity: Minor
                          Found in lib/readline.js - About 7 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 GenerateOutput has 189 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          def GenerateOutput(target_list, target_dicts, data, params):
                            options = params['options']
                            flavor = gyp.common.GetFlavor(params)
                            generator_flags = params.get('generator_flags', {})
                            builddir_name = generator_flags.get('output_dir', 'out')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/make.py - About 7 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language