Showing 1,370 of 2,859 total issues

File core.js has 339 lines of code (exceeds 250 allowed). Consider refactoring.
Open


var CC = require("config-chain").ConfigChain
var inherits = require("inherits")
var configDefs = require("./defaults.js")
var types = configDefs.types
Severity: Minor
Found in deps/npm/lib/config/core.js - About 4 hrs to fix

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

    function isFullWidthCodePoint(code) {
      if (isNaN(code)) {
        return false;
      }
    
    
    Severity: Minor
    Found in lib/readline.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 exports has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    var server = module.exports = http.createServer(function (req, res) {
      if (useDomains) {
        var dom = domain.create();
        dom.add(req);
        dom.add(res);
    Severity: Minor
    Found in benchmark/http_simple.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 GetClosurizedNamespace has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

      def GetClosurizedNamespace(self, identifier):
        """Given an identifier, returns the namespace that identifier is from.
    
        Args:
          identifier: The identifier to extract a namespace from.
    Severity: Minor
    Found in tools/closure_linter/closure_linter/javascriptstatetracker.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 Finalize has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

      def Finalize(self, state, tokenizer_mode):
        """Perform all checks that need to occur after all lines are processed."""
        # Call the base class's Finalize function.
        super(JavaScriptLintRules, self).Finalize(state, tokenizer_mode)
    
    
    Severity: Minor
    Found in tools/closure_linter/closure_linter/javascriptlintrules.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 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

    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

        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

          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

                  Severity
                  Category
                  Status
                  Source
                  Language