Showing 2,859 of 2,859 total issues

File sodium.js has 352 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// 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/sodium/sodium.js - About 4 hrs to fix

    File profile.js has 351 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Copyright 2009 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/profile.js - About 4 hrs to fix

      Function removeList has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

      def removeList(count=0):
          # don't allow "keep" items to creep in here.
          global remove
          remove = remove - keep
          if(count > 10):
      Severity: Minor
      Found in tools/icu/icutrim.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 _GetAllowableIndentations has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

        def _GetAllowableIndentations(self):
          """Computes the set of allowable indentations.
      
          Returns:
            The set of allowable indentations, given the current stack.
      Severity: Minor
      Found in tools/closure_linter/closure_linter/indentation.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 output_words has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

        def output_words(self, f, start_address, end_address,
                         highlight_address, desc):
          region = self.reader.FindRegion(highlight_address)
          if region is None:
            f.write("<h3>Address 0x%x not found in the dump.</h3>\n" %
      Severity: Minor
      Found in deps/v8/tools/grokdump.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 Load has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

        def Load(self, mmap_info, code_map, options):
          # Skip kernel mmaps when requested using the fact that their tid
          # is 0.
          if mmap_info.tid == 0 and not options.kernel:
            return True
      Severity: Minor
      Found in deps/v8/tools/ll_prof.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 formatValue has 110 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function formatValue(ctx, value, recurseTimes) {
        // Provide a hook for user-specified inspect functions.
        // Check that value is an object with an inspect function on it
        if (ctx.customInspect &&
            value &&
      Severity: Major
      Found in lib/util.js - About 4 hrs to fix

        Function get has 110 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Object.defineProperty(exports, "defaults", {get: function () {
          if (defaults) return defaults
        
          if (process.env.PREFIX) {
            globalPrefix = process.env.PREFIX
        Severity: Major
        Found in deps/npm/lib/config/defaults.js - About 4 hrs to fix

          NinjaWriter has 34 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class NinjaWriter:
            def __init__(self, qualified_target, target_outputs, base_dir, build_dir,
                         output_file, toplevel_build, output_file_name, flavor,
                         toplevel_dir=None):
              """
          Severity: Minor
          Found in tools/gyp/pylib/gyp/generator/ninja.py - About 4 hrs to fix

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

                    if (last_cmd === 'info locals') {
                      var locals = body.locals;
                      if (locals.length === 0) {
                        result = 'No locals';
                      } else {
            Severity: Major
            Found in deps/v8/src/d8.js and 1 other location - About 4 hrs to fix
            deps/v8/src/d8.js on lines 1452..1471

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

            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

                    } else if (last_cmd === 'info args') {
                      var args = body.arguments;
                      if (args.length === 0) {
                        result = 'No arguments';
                      } else {
            Severity: Major
            Found in deps/v8/src/d8.js and 1 other location - About 4 hrs to fix
            deps/v8/src/d8.js on lines 1440..1471

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

            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

              } else if (command == "buffer") {
                var n = parseInt(arg, 10)
                if (n <= 0) throw new Error("bytes called with n <= 0");
                if (storedBuffer[n] === undefined) {
                  storedBuffer[n] = new Buffer(n);
            Severity: Major
            Found in benchmark/http_simple_auto.js and 1 other location - About 4 hrs to fix
            benchmark/http_simple.js on lines 60..85

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

            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

              } else if (command == 'unicode') {
                var n = ~~arg;
                if (n <= 0)
                  throw new Error('unicode called with n <= 0');
                if (storedUnicode[n] === undefined) {
            Severity: Major
            Found in benchmark/http_simple.js and 1 other location - About 4 hrs to fix
            benchmark/http_simple_auto.js on lines 44..71

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

            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

            Object.defineProperty(Socket.prototype, 'readyState', {
              get: function() {
                if (this._connecting) {
                  return 'opening';
                } else if (this.readable && this.writable) {
            Severity: Major
            Found in lib/net.js and 1 other location - About 4 hrs to fix
            lib/_tls_legacy.js on lines 508..522

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

            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

            Object.defineProperty(CryptoStream.prototype, 'readyState', {
              get: function() {
                if (this._connecting) {
                  return 'opening';
                } else if (this.readable && this.writable) {
            Severity: Major
            Found in lib/_tls_legacy.js and 1 other location - About 4 hrs to fix
            lib/net.js on lines 372..386

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

            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 setBreakpoint has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

            Interface.prototype.setBreakpoint = function(script, line,
                                                         condition, silent) {
              if (!this.requireConnection()) return;
            
              var self = this,
            Severity: Minor
            Found in lib/_debugger.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 Zlib has a Cognitive Complexity of 29 (exceeds 5 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: Minor
            Found in lib/zlib.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 WriteRules has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

              def WriteRules(self, rules, extra_sources, extra_outputs,
                             extra_mac_bundle_resources, part_of_all):
                """Write Makefile code for any 'rules' 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 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 LoadTargetBuildFile has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

            def LoadTargetBuildFile(build_file_path, data, aux_data, variables, includes,
                                    depth, check, load_dependencies):
              # If depth is set, predefine the DEPTH variable to be a relative path from
              # this build file's directory to the directory identified by depth.
              if depth:
            Severity: Minor
            Found in tools/gyp/pylib/gyp/input.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 TakeOverOnlyChild has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

              def TakeOverOnlyChild(self, recurse=False):
                """If this PBXGroup has only one child and it's also a PBXGroup, take
                it over by making all of its children this object's children.
            
                This function will continue to take over only children when those children
            Severity: Minor
            Found in tools/gyp/pylib/gyp/xcodeproj_file.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

            Severity
            Category
            Status
            Source
            Language