Showing 1,370 of 2,859 total issues

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

    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

      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

        File run_benchmarks.py has 323 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: Minor
        Found in deps/v8/tools/run_benchmarks.py - About 3 hrs to fix

          Function fromList has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

          function fromList(n, state) {
            var list = state.buffer;
            var length = state.length;
            var stringMode = !!state.decoder;
            var objectMode = !!state.objectMode;
          Severity: Minor
          Found in lib/_stream_readable.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 splay_ has a Cognitive Complexity of 26 (exceeds 5 allowed). 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: Minor
          Found in deps/v8/benchmarks/spinning-balls/splay-tree.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 DebugEventDetails has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

          function DebugEventDetails(response) {
            var details = {text:'', running:false};
          
            // Get the running state.
            details.running = response.running();
          Severity: Minor
          Found in deps/v8/src/d8.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 bnToString has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

          function bnToString(b) {
            var this_array = this.array;
            if(this.s < 0) return "-"+this.negate().toString(b);
            var k;
            if(b == 16) k = 4;
          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 splay_ has a Cognitive Complexity of 26 (exceeds 5 allowed). 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: Minor
          Found in deps/v8/benchmarks/splay.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 splay_ has a Cognitive Complexity of 26 (exceeds 5 allowed). 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: Minor
          Found in deps/v8/tools/splaytree.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 CheckLines has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

            def CheckLines(self, filename, lines_iter, is_html):
              """Checks a file, given as an iterable of lines, for warnings and errors.
          
              Args:
                filename: The name of the file to check.
          Severity: Minor
          Found in tools/closure_linter/closure_linter/checkerbase.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 FilterTestCasesByStatus has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

            def FilterTestCasesByStatus(self, warn_unused_rules,
                                        flaky_tests="dontcare",
                                        slow_tests="dontcare",
                                        pass_fail_tests="dontcare"):
              filtered = []
          Severity: Minor
          Found in deps/v8/tools/testrunner/local/testsuite.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 _init has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

          TLSSocket.prototype._init = function(socket) {
            assert(this._handle);
          
            // lib/net.js expect this value to be non-zero if write hasn't been flushed
            // immediately
          Severity: Minor
          Found in lib/_tls_wrap.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 stepCommandToJSONRequest_ has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

          DebugRequest.prototype.stepCommandToJSONRequest_ = function(args, type) {
            // Requesting a step is through the continue command with additional
            // arguments.
            var request = this.createRequest('continue');
            request.arguments = {};
          Severity: Minor
          Found in deps/v8/src/d8.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 bnpFromString has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

          function bnpFromString(s,b) {
            var this_array = this.array;
            var k;
            if(b == 16) k = 4;
            else if(b == 8) k = 3;
          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 server has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

          var server = http.createServer(function (req, res) {
            var commands = req.url.split("/");
            var command = commands[1];
            var body = "";
            var arg = commands[2];
          Severity: Minor
          Found in benchmark/http_simple_auto.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 __init__ has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

            def __init__(self, flag_token):
              """Creates the DocFlag object and attaches it to the given start token.
          
              Args:
                flag_token: The starting token of the flag.
          Severity: Minor
          Found in tools/closure_linter/closure_linter/statetracker.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 ReadFlagsFromFiles has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

            def ReadFlagsFromFiles(self, argv, force_gnu=True):
              """Processes command line args, but also allow args to be read from file.
              Args:
                argv: A list of strings, usually sys.argv[1:], which may contain one or
                  more flagfile directives of the form --flagfile="./filename".
          Severity: Minor
          Found in tools/closure_linter/gflags.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 Finalize2 has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

            def Finalize2(self, xcode_targets, xcode_target_to_target_dict):
              # Finalize2 needs to happen in a separate step because the process of
              # updating references to other projects depends on the ordering of targets
              # within remote project files.  Finalize1 is responsible for sorting duty,
              # and once all project files are sorted, Finalize2 can come in and update
          Severity: Minor
          Found in tools/gyp/pylib/gyp/generator/xcode.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 ParseSolution has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

          def ParseSolution(solution_file):
            # All projects, their clsid and paths.
            projects = dict()
          
            # A list of dependencies associated with a project.
          Severity: Minor
          Found in tools/gyp/tools/pretty_sln.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