Showing 1,896 of 2,859 total issues

Function linkMans has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function linkMans (pkg, folder, parent, gtop, cb) {
  if (!pkg.man || !gtop || process.platform === "win32") return cb()

  var manRoot = path.resolve(npm.config.get("prefix"), "share", "man")
  log.verbose("linkMans", "man files are", pkg.man, "in", manRoot)
Severity: Minor
Found in deps/npm/lib/build.js - About 1 hr to fix

    Function _AddConfigurationToMSVSProject has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config):
      """Adds a configuration to the MSVS project.
    
      Many settings in a vcproj file are specific to a configuration.  This
      function the main part of the vcproj file that's configuration specific.
    Severity: Minor
    Found in tools/gyp/pylib/gyp/generator/msvs.py - About 1 hr to fix

      Function GenerateOutputForConfig has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def GenerateOutputForConfig(target_list, target_dicts, data,
                                  params, config_to_use):
        options = params['options']
        generator_flags = params['generator_flags']
      
      
      Severity: Minor
      Found in tools/gyp/pylib/gyp/generator/cmake.py - About 1 hr to fix

        Function BuildOptions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def BuildOptions():
          result = optparse.OptionParser()
          result.add_option("-m", "--mode", help="The test modes in which to run (comma-separated)",
              default='release')
          result.add_option("-v", "--verbose", help="Verbose output",
        Severity: Minor
        Found in tools/test.py - About 1 hr to fix

          Function checkExecSyncError has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function checkExecSyncError(ret) {
            if (ret.error || ret.status !== 0) {
              var err = ret.error;
              ret.error = null;
          
          
          Severity: Minor
          Found in lib/child_process.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 parseListItem has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function parseListItem(item) {
            if (item.options) item.options.forEach(parseListItem);
            if (!item.textRaw) return;
          
            // the goal here is to find the name, type, default, and optional.
          Severity: Minor
          Found in tools/doc/json.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 flush has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          Zlib.prototype.flush = function(kind, callback) {
            var ws = this._writableState;
          
            if (util.isFunction(kind) || (util.isUndefined(kind) && !callback)) {
              callback = kind;
          Severity: Minor
          Found in lib/zlib.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 addRequest has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          Agent.prototype.addRequest = function(req, options) {
            // Legacy API: addRequest(req, host, port, path)
            if (typeof options === 'string') {
              options = {
                host: options,
          Severity: Minor
          Found in lib/_http_agent.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 listen has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function listen(self, address, port, addressType, backlog, fd, exclusive) {
            exclusive = !!exclusive;
          
            if (!cluster) cluster = require('cluster');
          
          
          Severity: Minor
          Found in lib/net.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 add has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          Domain.prototype.add = function(ee) {
            // If the domain is disposed or already added, then nothing left to do.
            if (this._disposed || ee.domain === this)
              return;
          
          
          Severity: Minor
          Found in lib/domain.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 _throws has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function _throws(shouldThrow, block, expected, message) {
            var actual;
          
            if (util.isString(expected)) {
              message = expected;
          Severity: Minor
          Found in lib/assert.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 getPublicKey has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          ECDH.prototype.getPublicKey = function getPublicKey(encoding, format) {
            var f;
            if (format) {
              if (typeof format === 'number')
                f = format;
          Severity: Minor
          Found in lib/crypto.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 bnpSubTo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function bnpSubTo(a,r) {
            var this_array = this.array;
            var r_array = r.array;
            var a_array = a.array;
            var i = 0, c = 0, m = Math.min(a.t,this.t);
          Severity: Minor
          Found in deps/v8/benchmarks/crypto.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 main has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function main(conf) {
            var dur = +conf.dur;
            var type = conf.type;
            var size = +conf.size;
            var encoding;
          Severity: Minor
          Found in benchmark/fs/write-stream-throughput.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 GetCompletions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function GetCompletions(global, last, full) {
            var full_tokens = full.split();
            full = full_tokens.pop();
            var parts = full.split('.');
            parts.pop();
          Severity: Minor
          Found in deps/v8/src/d8.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 bnpAddTo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function bnpAddTo(a,r) {
            var this_array = this.array;
            var a_array = a.array;
            var r_array = r.array;
            var i = 0, c = 0, m = Math.min(a.t,this.t);
          Severity: Minor
          Found in deps/v8/benchmarks/crypto.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 a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          WorkerTask.prototype.run = function (packet) {
            if (packet == null) {
              return this.scheduler.suspendCurrent();
            } else {
              if (this.v1 == ID_HANDLER_A) {
          Severity: Minor
          Found in deps/v8/benchmarks/richards.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 sc_euclid_gcd has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function sc_euclid_gcd(a, b) {
              var temp;
              if (a === 0) return b;
              if (b === 0) return a;
              if (a < 0) {a = -a;};
          Severity: Minor
          Found in deps/v8/benchmarks/earley-boyer.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 chainTest has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          function chainTest(n) {
            planner = new Planner();
            var prev = null, first = null, last = null;
          
            // Build chain of n equality constraints
          Severity: Minor
          Found in deps/v8/benchmarks/deltablue.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 cleanUpFuncEntries has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          Profile.prototype.cleanUpFuncEntries = function() {
            var referencedFuncEntries = [];
            var entries = this.codeMap_.getAllDynamicEntriesWithAddresses();
            for (var i = 0, l = entries.length; i < l; ++i) {
              if (entries[i][1].constructor === Profile.FunctionEntry) {
          Severity: Minor
          Found in deps/v8/tools/profile.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

          Severity
          Category
          Status
          Source
          Language