Showing 2,859 of 2,859 total issues

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

  match_this = (r'\s*' + macro + r'\((\s*' +
                match_constant + r'\s*' + operator + r'[^<>].*|'
                r'.*[^<>]' + operator + r'\s*' + match_constant +
Severity: Major
Found in tools/cpplint.py and 1 other location - About 3 hrs to fix
tools/gyp/pylib/gyp/generator/make.py on lines 231..441

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 65.

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

SHARED_HEADER = ("""\
# We borrow heavily from the kernel build setup, though we are simpler since
# we don't have Kconfig tweaking settings on us.

# The implicit make rules have it looking for RCS files, among other things.
Severity: Major
Found in tools/gyp/pylib/gyp/generator/make.py and 1 other location - About 3 hrs to fix
tools/cpplint.py on lines 1992..1994

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 65.

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

Function startup has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function startup() {
    var EventEmitter = NativeModule.require('events').EventEmitter;

    process.__proto__ = Object.create(EventEmitter.prototype, {
      constructor: {
Severity: Major
Found in src/node.js - About 3 hrs to fix

    Function renderScene has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function renderScene(){
        var scene = new Flog.RayTracer.Scene();
    
        scene.camera = new Flog.RayTracer.Camera(
                            new Flog.RayTracer.Vector(0, 0, -15),
    Severity: Major
    Found in deps/v8/benchmarks/raytrace.js - About 3 hrs to fix

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

      function Decipheriv(cipher, key, iv, options) {
        if (!(this instanceof Decipheriv))
          return new Decipheriv(cipher, key, iv, options);
      
        this._handle = new binding.CipherBase(false);
      Severity: Major
      Found in lib/crypto.js and 1 other location - About 3 hrs to fix
      lib/crypto.js on lines 223..231

      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 99.

      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

      function Cipheriv(cipher, key, iv, options) {
        if (!(this instanceof Cipheriv))
          return new Cipheriv(cipher, key, iv, options);
        this._handle = new binding.CipherBase(true);
        this._handle.initiv(cipher, toBuf(key), toBuf(iv));
      Severity: Major
      Found in lib/crypto.js and 1 other location - About 3 hrs to fix
      lib/crypto.js on lines 279..288

      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 99.

      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

      File push_to_trunk.py has 299 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/usr/bin/env python
      # Copyright 2013 the V8 project authors. All rights reserved.
      # Redistribution and use in source and binary forms, with or without
      # modification, are permitted provided that the following conditions are
      # met:
      Severity: Minor
      Found in deps/v8/tools/push-to-trunk/push_to_trunk.py - About 3 hrs to fix

        XCObject has 27 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class XCObject(object):
          """The abstract base of all class types used in Xcode project files.
        
          Class variables:
            _schema: A dictionary defining the properties of this class.  The keys to
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 3 hrs to fix

          Function finishSection has 79 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function finishSection(section, parent) {
            if (!section || !parent) {
              throw new Error('Invalid finishSection call\n'+
                              JSON.stringify(section) + '\n' +
                              JSON.stringify(parent));
          Severity: Major
          Found in tools/doc/json.js - About 3 hrs to fix

            Function _processChunk has 79 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {
              var availInBefore = chunk && chunk.length;
              var availOutBefore = this._chunkSize - this._offset;
              var inOff = 0;
            
            
            Severity: Major
            Found in lib/zlib.js - About 3 hrs to fix

              Function runBlock8 has 79 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function runBlock8() {
                  for (var i = 0; i < 7; i++) {
                    s21[i].match(/\d+/g);
                    'nsgre'.replace(re64, '');
                    'orsber'.replace(re64, '');
              Severity: Major
              Found in deps/v8/benchmarks/regexp.js - About 3 hrs to fix

                Function Zlib has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function Zlib(opts, mode) {
                  this._opts = opts = opts || {};
                  this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK;
                
                  Transform.call(this, opts);
                Severity: Major
                Found in lib/zlib.js - About 3 hrs to fix

                  Function createSecureContext has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  exports.createSecureContext = function createSecureContext(options, context) {
                    if (!options) options = {};
                  
                    var secureOptions = options.secureOptions;
                    if (options.honorCipherOrder)
                  Severity: Major
                  Found in lib/_tls_common.js - About 3 hrs to fix

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

                      return {
                        root: allParts[0],
                        dir: allParts[0] + allParts[1].slice(0, -1),
                        base: allParts[2],
                        ext: allParts[3],
                    Severity: Major
                    Found in lib/path.js and 1 other location - About 3 hrs to fix
                    lib/path.js on lines 608..614

                    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 97.

                    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

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

                      return {
                        root: allParts[0],
                        dir: allParts[0] + allParts[1].slice(0, -1),
                        base: allParts[2],
                        ext: allParts[3],
                    Severity: Major
                    Found in lib/path.js and 1 other location - About 3 hrs to fix
                    lib/path.js on lines 404..410

                    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 97.

                    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

                    Function RtfGenerator has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function RtfGenerator() {
                      var self = this,
                          did_write_anything = false;
                    
                      Stream.call(this);
                    Severity: Minor
                    Found in tools/license2rtf.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 removeListener has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function removeListener(type, listener) {
                      var list, position, length, i;
                    
                      if (!util.isFunction(listener))
                        throw TypeError('listener must be a function');
                    Severity: Minor
                    Found in lib/events.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 workerInit has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function workerInit() {
                      var handles = {};
                    
                      // Called from src/node.js
                      cluster._setupWorker = function() {
                    Severity: Minor
                    Found in lib/cluster.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 listOnTimeout has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function listOnTimeout() {
                      var msecs = this.msecs;
                      var list = this;
                    
                      debug('timeout callback %d', msecs);
                    Severity: Minor
                    Found in lib/timers.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 WriteActions has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def WriteActions(self, actions, extra_sources, extra_outputs,
                                       extra_mac_bundle_resources, part_of_all):
                        """Write Makefile code for any 'actions' from the gyp input.
                    
                        extra_sources: a list that will be filled in with newly generated source
                    Severity: Minor
                    Found in tools/gyp/pylib/gyp/generator/make.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