Showing 1,896 of 2,859 total issues

File composer.js has 433 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/profviz/composer.js - About 6 hrs to fix

    File _http_outgoing.js has 432 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_outgoing.js - About 6 hrs to fix

      Function sh_highlightString has 157 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function sh_highlightString(inputString, language) {
        if (/Konqueror/.test(navigator.userAgent)) {
          if (! language.konquered) {
            for (var s = 0; s < language.length; s++) {
              for (var p = 0; p < language[s].length; p++) {
      Severity: Major
      Found in doc/sh_main.js - About 6 hrs to fix

        Function connectionListener has 157 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function connectionListener(socket) {
          var self = this;
          var outgoing = [];
          var incoming = [];
        
        
        Severity: Major
        Found in lib/_http_server.js - About 6 hrs to fix

          Function Stringify has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

          function Stringify(x, depth) {
            if (depth === undefined)
              depth = stringifyDepthLimit;
            else if (depth === 0)
              return "*";
          Severity: Minor
          Found in deps/v8/src/d8.js - About 6 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 runBlock9 has 153 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function runBlock9() {
              for (var i = 0; i < 5; i++) {
                s94[i].split(re32);
                s95[i].split(re32);
                'svz_zlfcnpr_hfre-ivrj-pbzzragf,svz_zlfcnpr_havgrq-fgngrf'.split(re20);
          Severity: Major
          Found in deps/v8/benchmarks/regexp.js - About 6 hrs to fix

            Function checkServerIdentity has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

            exports.checkServerIdentity = function checkServerIdentity(host, cert) {
              // Create regexp to much hostnames
              function regexpify(host, wildcards) {
                // Add trailing dot (make hostnames uniform)
                if (!/\.$/.test(host)) host += '.';
            Severity: Minor
            Found in lib/tls.js - About 6 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 Write has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

              def Write(self, qualified_target, base_path, output_filename, spec, configs,
                        part_of_all):
                """The main entry point: writes a .mk file for a single target.
            
                Arguments:
            Severity: Minor
            Found in tools/gyp/pylib/gyp/generator/make.py - About 6 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 AdjustStaticLibraryDependencies has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

            def AdjustStaticLibraryDependencies(flat_list, targets, dependency_nodes,
                                                sort_dependencies):
              # Recompute target "dependencies" properties.  For each static library
              # target, remove "dependencies" entries referring to other static libraries,
              # unless the dependency has the "hard_dependency" attribute set.  For each
            Severity: Minor
            Found in tools/gyp/pylib/gyp/input.py - About 6 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 sh_main.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
            SHJS - Syntax Highlighting in JavaScript
            Copyright (C) 2007, 2008 gnombat@users.sourceforge.net
            License: http://shjs.sourceforge.net/doc/gplv3.html
            */
            Severity: Minor
            Found in doc/sh_main.js - About 5 hrs to fix

              Function runBlock10 has 148 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function runBlock10() {
                  for (var i = 0; i < 3; i++) {
                    '%3Szxg=ra-HF'.replace(re39, '');
                    '-8'.replace(re40, '');
                    '-8'.replace(re10, '');
              Severity: Major
              Found in deps/v8/benchmarks/regexp.js - About 5 hrs to fix

                Function CustomSearch has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                Open

                def CustomSearch(start_token, func, end_func=None, distance=None,
                                 reverse=False):
                  """Returns the first token where func is True within distance of this token.
                
                  Args:
                Severity: Minor
                Found in tools/closure_linter/closure_linter/tokenutil.py - About 5 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

                FlagValues has 43 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class FlagValues:
                  """Registry of 'Flag' objects.
                
                  A 'FlagValues' can then scan command line arguments, passing flag
                  arguments through to the 'Flag' objects that it owns.  It also
                Severity: Minor
                Found in tools/closure_linter/gflags.py - About 5 hrs to fix

                  File path.js has 408 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/path.js - About 5 hrs to fix

                    Function emitKeys has 144 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function emitKeys(stream, s) {
                      if (util.isBuffer(s)) {
                        if (s[0] > 127 && util.isUndefined(s[1])) {
                          s[0] -= 128;
                          s = '\x1b' + s.toString(stream.encoding || 'utf-8');
                    Severity: Major
                    Found in lib/readline.js - About 5 hrs to fix

                      Function changeBreakpointCommandToJSONRequest_ has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function(args, command) {
                      
                        var request;
                      
                        // Check for exception breaks first:
                      Severity: Minor
                      Found in deps/v8/src/d8.js - About 5 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 makeArchy_ has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function makeArchy_ (data, long, dir, depth, parent, d) {
                        if (typeof data === "string") {
                          if (depth -1 <= npm.config.get("depth")) {
                            // just missing
                            var unmet = "UNMET DEPENDENCY"
                      Severity: Minor
                      Found in deps/npm/lib/ls.js - About 5 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 js2c.py has 405 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      #!/usr/bin/env python
                      #
                      # Copyright 2012 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: Minor
                      Found in deps/v8/tools/js2c.py - About 5 hrs to fix

                        Function setupChannel has 142 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function setupChannel(target, channel) {
                          target._channel = channel;
                          target._handleQueue = null;
                        
                          var decoder = new StringDecoder('utf8');
                        Severity: Major
                        Found in lib/child_process.js - About 5 hrs to fix

                          Function ParagraphParser has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function ParagraphParser() {
                            var self = this,
                                block_is_license_block = false,
                                block_has_c_style_comment,
                                is_first_line_in_paragraph,
                          Severity: Minor
                          Found in tools/license2rtf.js - About 5 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