Showing 2,859 of 2,859 total issues

File test.py has 1176 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
#
# Copyright 2008 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
Severity: Major
Found in tools/test.py - About 3 days to fix

    File generate-runtime-tests.py has 1175 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python
    # Copyright 2014 the V8 project authors. All rights reserved.
    # Use of this source code is governed by a BSD-style license that can be
    # found in the LICENSE file.
    
    
    Severity: Major
    Found in deps/v8/tools/generate-runtime-tests.py - About 3 days to fix

      File test_scripts.py has 1174 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: Major
      Found in deps/v8/tools/push-to-trunk/test_scripts.py - About 3 days to fix

        File xcode_emulation.py has 1097 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # Copyright (c) 2012 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.
        
        """
        Severity: Major
        Found in tools/gyp/pylib/gyp/xcode_emulation.py - About 2 days to fix

          Function Sodium has a Cognitive Complexity of 136 (exceeds 5 allowed). Consider refactoring.
          Open

          var Sodium = (function() {
            "use strict";
          
            var kinds = ["FUNCTION", "OPTIMIZED_FUNCTION", "STUB", "BUILTIN",
                         "LOAD_IC", "KEYED_LOAD_IC", "CALL_IC", "KEYED_CALL_IC",
          Severity: Minor
          Found in deps/v8/tools/sodium/sodium.js - About 2 days 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 135 (exceeds 5 allowed). Consider refactoring.
          Open

          def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
                          options, generator_flags, all_qualified_targets, output):
          
            # The make generator does this always.
            # TODO: It would be nice to be able to tell CMake all dependencies.
          Severity: Minor
          Found in tools/gyp/pylib/gyp/generator/cmake.py - About 2 days 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 resolveObject has a Cognitive Complexity of 134 (exceeds 5 allowed). Consider refactoring.
          Open

          Url.prototype.resolveObject = function(relative) {
            if (util.isString(relative)) {
              var rel = new Url();
              rel.parse(relative, false, true);
              relative = rel;
          Severity: Minor
          Found in lib/url.js - About 2 days 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

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

          SplayTree.prototype.splay_ = function(key) {
            if (this.isEmpty()) {
              return;
            }
            // Create a dummy node.  The use of the dummy node is a bit
          Severity: Major
          Found in deps/v8/benchmarks/spinning-balls/splay-tree.js and 2 other locations - About 2 days to fix
          deps/v8/benchmarks/splay.js on lines 293..352
          deps/v8/tools/splaytree.js on lines 224..283

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

          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 3 locations. Consider refactoring.
          Open

          SplayTree.prototype.splay_ = function(key) {
            if (this.isEmpty()) {
              return;
            }
            // Create a dummy node.  The use of the dummy node is a bit
          Severity: Major
          Found in deps/v8/benchmarks/splay.js and 2 other locations - About 2 days to fix
          deps/v8/benchmarks/spinning-balls/splay-tree.js on lines 198..257
          deps/v8/tools/splaytree.js on lines 224..283

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

          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 3 locations. Consider refactoring.
          Open

          SplayTree.prototype.splay_ = function(key) {
            if (this.isEmpty()) {
              return;
            }
            // Create a dummy node.  The use of the dummy node is a bit
          Severity: Major
          Found in deps/v8/tools/splaytree.js and 2 other locations - About 2 days to fix
          deps/v8/benchmarks/spinning-balls/splay-tree.js on lines 198..257
          deps/v8/benchmarks/splay.js on lines 293..352

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

          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 net.js has 1029 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: Major
          Found in lib/net.js - About 2 days to fix

            Function RegExpBenchmark has a Cognitive Complexity of 126 (exceeds 5 allowed). Consider refactoring.
            Open

            function RegExpBenchmark() {
              var re0 = /^ba/;
              var re1 = /(((\w+):\/\/)([^\/:]*)(:(\d+))?)?([^#?]*)(\?([^#]*))?(#(.*))?/;
              var re2 = /^\s*|\s*$/g;
              var re3 = /\bQBZPbageby_cynprubyqre\b/;
            Severity: Minor
            Found in deps/v8/benchmarks/regexp.js - About 2 days 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 ExpandVariables has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring.
            Open

            def ExpandVariables(input, phase, variables, build_file):
              # Look for the pattern that gets expanded into variables
              if phase == PHASE_EARLY:
                variable_re = early_variable_re
                expansion_symbol = '<'
            Severity: Minor
            Found in tools/gyp/pylib/gyp/input.py - About 2 days 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 child_process.js has 973 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: Major
            Found in lib/child_process.js - About 2 days to fix

              Function parse has a Cognitive Complexity of 119 (exceeds 5 allowed). Consider refactoring.
              Open

              Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
                if (!util.isString(url)) {
                  throw new TypeError("Parameter 'url' must be a string, not " + typeof url);
                }
              
              
              Severity: Minor
              Found in lib/url.js - About 2 days 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 complete has a Cognitive Complexity of 116 (exceeds 5 allowed). Consider refactoring.
              Open

              REPLServer.prototype.complete = function(line, callback) {
                // There may be local variables to evaluate, try a nested REPL
                if (!util.isUndefined(this.bufferedCommand) && this.bufferedCommand.length) {
                  // Get a new array of inputed lines
                  var tmp = this.lines.slice();
              Severity: Minor
              Found in lib/repl.js - About 2 days 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 readline.js has 940 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: Major
              Found in lib/readline.js - About 2 days to fix

                File install.js has 896 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // npm install <pkg> <pkg> <pkg>
                //
                // See doc/install.md for more description
                
                // Managing contexts...
                Severity: Major
                Found in deps/npm/lib/install.js - About 2 days to fix

                  Function CheckToken has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def CheckToken(self, token, state):
                      """Checks a token, given the current parser_state, for warnings and errors.
                  
                      Args:
                        token: The current token under consideration
                  Severity: Minor
                  Found in tools/closure_linter/closure_linter/javascriptlintrules.py - About 2 days 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 PlotScriptComposer has 427 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function PlotScriptComposer(kResX, kResY, error_output) {
                    // Constants.
                    var kV8BinarySuffixes = ["/d8", "/libv8.so"];
                    var kStackFrames = 8;             // Stack frames to display in the plot.
                  
                  
                  Severity: Major
                  Found in deps/v8/tools/profviz/composer.js - About 2 days to fix
                    Severity
                    Category
                    Status
                    Source
                    Language