Showing 1,896 of 2,859 total issues

Function WriteTarget has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

  def WriteTarget(self, spec, config_name, config, link_deps, compile_deps):
    extra_link_deps = any(self.target_outputs.get(dep).Linkable()
                          for dep in spec.get('dependencies', [])
                          if dep in self.target_outputs)
    if spec['type'] == 'none' or (not link_deps and not extra_link_deps):
Severity: Minor
Found in tools/gyp/pylib/gyp/generator/ninja.py - 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 CheckForIncludeWhatYouUse has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
                              io=codecs):
  """Reports for missing stl includes.

  This function will output warnings to make sure you are including the headers
Severity: Minor
Found in tools/cpplint.py - 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 CheckForNonStandardConstructs has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def CheckForNonStandardConstructs(filename, clean_lines, linenum,
                                  class_state, error):
  """Logs an error if we see certain non-ANSI constructs ignored by gcc-2.

  Complain about several constructs which gcc-2 accepts, but which are
Severity: Minor
Found in tools/cpplint.py - 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 ClientRequest has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ClientRequest(options, cb) {
  var self = this;
  OutgoingMessage.call(self);

  if (util.isString(options)) {
Severity: Major
Found in lib/_http_client.js - About 4 hrs to fix

    Function runBlock3 has 102 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function runBlock3() {
        for (var i = 0; i < 27; i++) {
          s67[i].replace(/[A-Za-z]/g, '');
        }
        for (var i = 0; i < 23; i++) {
    Severity: Major
    Found in deps/v8/benchmarks/regexp.js - About 4 hrs to fix

      File MSVSVersion.py has 336 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # Copyright (c) 2013 Google Inc. All rights reserved.
      # Use of this source code is governed by a BSD-style license that can be
      # found in the LICENSE file.
      
      """Handle version information related to Visual Stuio."""
      Severity: Minor
      Found in tools/gyp/pylib/gyp/MSVSVersion.py - About 4 hrs to fix

        File module.js has 335 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/module.js - About 4 hrs to fix

          Function dedupe_ has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function dedupe_ (dir, filter, unavoidable, dryrun, silent, cb) {
            readInstalled(path.resolve(dir), {}, null, function (er, data, counter) {
              if (er) {
                return cb(er)
              }
          Severity: Major
          Found in deps/npm/lib/dedupe.js - About 4 hrs to fix

            File dgram.js has 334 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/dgram.js - About 4 hrs to fix

              Function list has 100 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function list (cb) {
                var msg = ""
                  , long = npm.config.get("long")
              
                var cli = npm.config.sources.cli.data
              Severity: Major
              Found in deps/npm/lib/config.js - About 4 hrs to fix

                File _http_server.js has 333 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/_http_server.js - About 4 hrs to fix

                  File navier-stokes.js has 333 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /**
                   * Copyright 2012 the V8 project authors. All rights reserved.
                   * Copyright 2009 Oliver Hunt <http://nerget.com>
                   *
                   * Permission is hereby granted, free of charge, to any person
                  Severity: Minor
                  Found in deps/v8/benchmarks/navier-stokes.js - About 4 hrs to fix

                    File defaults.js has 332 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    // defaults, types, and shorthands.
                    
                    
                    var path = require("path")
                      , url = require("url")
                    Severity: Minor
                    Found in deps/npm/lib/config/defaults.js - About 4 hrs to fix

                      File error-handler.js has 331 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      
                      module.exports = errorHandler
                      
                      var cbCalled = false
                        , log = require("npmlog")
                      Severity: Minor
                      Found in deps/npm/lib/utils/error-handler.js - About 3 hrs to fix

                        Function memory has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                        Open

                        REPLServer.prototype.memory = function memory(cmd) {
                          var self = this;
                        
                          self.lines = self.lines || [];
                          self.lines.level = self.lines.level || [];
                        Severity: Minor
                        Found in lib/repl.js - About 3 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 bnpDivRemTo has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function bnpDivRemTo(m,q,r) {
                          var pm = m.abs();
                          if(pm.t <= 0) return;
                          var pt = this.abs();
                          if(pt.t < pm.t) {
                        Severity: Minor
                        Found in deps/v8/benchmarks/crypto.js - About 3 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 errorHandler has a Cognitive Complexity of 27 (exceeds 5 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: Minor
                        Found in deps/npm/lib/utils/error-handler.js - About 3 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 GetAllDefines has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def GetAllDefines(target_list, target_dicts, data, config_name, params):
                          """Calculate the defines for a project.
                        
                          Returns:
                            A dict that includes explict defines declared in gyp files along with all of
                        Severity: Minor
                        Found in tools/gyp/pylib/gyp/generator/eclipse.py - About 3 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 CheckBraces has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def CheckBraces(filename, clean_lines, linenum, error):
                          """Looks for misplaced braces (e.g. at the end of line).
                        
                          Args:
                            filename: The name of the current file.
                        Severity: Minor
                        Found in tools/cpplint.py - About 3 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

                        File _stream_writable.js has 329 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/_stream_writable.js - About 3 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language