Showing 2,859 of 2,859 total issues

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

                      Function targetResolver has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function targetResolver (where, context, deps, devDeps) {
                        var alreadyInstalledManually = []
                          , resolveLeft = 0
                          , nm = path.resolve(where, "node_modules")
                          , parent = context.parent
                      Severity: Major
                      Found in deps/npm/lib/install.js - About 3 hrs to fix

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                          if (util.isFunction(options) || !options) {
                            options = { encoding: 'utf8', mode: 438 /*=0666*/, flag: 'w' };
                          } else if (util.isString(options)) {
                            options = { encoding: options, mode: 438, flag: 'w' };
                          } else if (!util.isObject(options)) {
                        Severity: Major
                        Found in lib/fs.js and 1 other location - About 3 hrs to fix
                        lib/fs.js on lines 1125..1131

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 112.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                          if (util.isFunction(options) || !options) {
                            options = { encoding: 'utf8', mode: 438 /*=0666*/, flag: 'a' };
                          } else if (util.isString(options)) {
                            options = { encoding: options, mode: 438, flag: 'a' };
                          } else if (!util.isObject(options)) {
                        Severity: Major
                        Found in lib/fs.js and 1 other location - About 3 hrs to fix
                        lib/fs.js on lines 1070..1076

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 112.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        StateTracker has 31 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class StateTracker(object):
                          """EcmaScript state tracker.
                        
                          Tracks block depth, function names, etc. within an EcmaScript token stream.
                          """
                        Severity: Minor
                        Found in tools/closure_linter/closure_linter/statetracker.py - About 3 hrs to fix

                          MakefileWriter has 31 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class MakefileWriter:
                            """MakefileWriter packages up the writing of one target-specific foobar.mk.
                          
                            Its only real entry point is Write(), and is mostly used for namespacing.
                            """
                          Severity: Minor
                          Found in tools/gyp/pylib/gyp/generator/make.py - About 3 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language