Showing 1,657 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 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 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 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 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 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

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

              function bnModPow(e,m) {
                var e_array = e.array;
                var i = e.bitLength(), k, r = nbv(1), z;
                if(i <= 0) return r;
                else if(i < 18) k = 1;
              Severity: Minor
              Found in deps/v8/benchmarks/crypto.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 WriteSpec has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
              Open

                def WriteSpec(self, spec, config_name, generator_flags):
                  """The main entry point for NinjaWriter: write the build rules for a spec.
              
                  Returns a Target object, which represents the output paths for this spec.
                  Returns None if there are no outputs (e.g. a settings-only 'none' type
              Severity: Minor
              Found in tools/gyp/pylib/gyp/generator/ninja.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

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

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

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

                def GetCflags(self, configname, arch=None):
                  """Returns flags that need to be added to .c, .cc, .m, and .mm
                  compilations."""
                  # This functions (and the similar ones below) do not offer complete
                  # emulation of all xcode_settings keys. They're implemented on demand.
              Severity: Minor
              Found in tools/gyp/pylib/gyp/xcode_emulation.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

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

              def load_fields():
                      inlfilename = sys.argv[3];
                      inlfile = open(inlfilename, 'r');
              
                      #
              Severity: Minor
              Found in deps/v8/tools/gen-postmortem-metadata.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

              File _http_client.js has 397 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_client.js - About 5 hrs to fix
                Severity
                Category
                Status
                Source
                Language