Showing 1,657 of 2,859 total issues

File run-tests.py has 480 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/run-tests.py - About 7 hrs to fix

    Function TextWrap has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

    def TextWrap(text, length=None, indent='', firstline_indent=None, tabs='    '):
      """Wraps a given text to a maximum line length and returns it.
    
      We turn lines that only contain whitespaces into empty lines.  We keep
      new lines and tabs (e.g., we do not treat tabs as spaces).
    Severity: Minor
    Found in tools/closure_linter/gflags.py - About 7 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 Finalize1 has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

      def Finalize1(self, xcode_targets, serialize_all_tests):
        # Collect a list of all of the build configuration names used by the
        # various targets in the file.  It is very heavily advised to keep each
        # target in an entire project (even across multiple project files) using
        # the same set of configuration names.
    Severity: Minor
    Found in tools/gyp/pylib/gyp/generator/xcode.py - About 7 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 Execute has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

    def Execute(arch, mode, args, options, suites, workspace):
      print(">>> Running tests for %s.%s" % (arch, mode))
    
      dist = Distribution(options)
    
    
    Severity: Minor
    Found in deps/v8/tools/run-deopt-fuzzer.py - About 7 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 Main has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

    def Main():
      parser = BuildOptionParser()
      (options, args) = parser.parse_args()
    
      if not ProcessOptions(options, args):
    Severity: Minor
    Found in deps/v8/tools/generate-runtime-tests.py - About 7 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 GetAllIncludeDirectories has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
    Open

    def GetAllIncludeDirectories(target_list, target_dicts,
                                 shared_intermediate_dirs, config_name, params):
      """Calculate the set of include directories to be used.
    
      Returns:
    Severity: Minor
    Found in tools/gyp/pylib/gyp/generator/eclipse.py - About 7 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 common_includes.py has 467 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: Minor
    Found in deps/v8/tools/push-to-trunk/common_includes.py - About 7 hrs to fix

      File deltablue.js has 464 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // Copyright 2008 the V8 project authors. All rights reserved.
      // Copyright 1996 John Maloney and Mario Wolczko.
      
      // This program is free software; you can redistribute it and/or modify
      // it under the terms of the GNU General Public License as published by
      Severity: Minor
      Found in deps/v8/benchmarks/deltablue.js - About 7 hrs to fix

        Function formatValue has a Cognitive Complexity of 46 (exceeds 5 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: Minor
        Found in lib/util.js - About 7 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 main has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
        Open

        def main(argv=None):
          if argv is None:
            argv = sys.argv
        
          usage = "gyptest.py [-ahlnq] [-f formats] [test ...]"
        Severity: Minor
        Found in tools/gyp/gyptest.py - About 7 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

        Generator has 50 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Generator(object):
        
          def RandomVariable(self, varname, vartype, simple):
            if simple:
              return self._Variable(varname, self.GENERATORS[vartype][0])
        Severity: Minor
        Found in deps/v8/tools/generate-runtime-tests.py - About 7 hrs to fix

          File zlib.js has 456 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/zlib.js - About 6 hrs to fix

            Function shouldUpdate has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
            Open

            function shouldUpdate (args, dir, dep, has, req, depth, cb, type) {
              // look up the most recent version.
              // if that's what we already have, or if it's not on the args list,
              // then dive into it.  Otherwise, cb() with the data.
            
            
            Severity: Minor
            Found in deps/npm/lib/outdated.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 __init__ has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
            Open

              def __init__(self, properties=None, id=None, parent=None,
                           force_outdir=None, force_prefix=None, force_extension=None):
                # super
                XCTarget.__init__(self, properties, id, parent)
            
            
            Severity: Minor
            Found in tools/gyp/pylib/gyp/xcodeproj_file.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 load_objects has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
            Open

            def load_objects():
                    objfilename = sys.argv[2];
                    objfile = open(objfilename, 'r');
                    in_insttype = False;
            
            
            Severity: Minor
            Found in deps/v8/tools/gen-postmortem-metadata.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 FullDump has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
            Open

            def FullDump(reader, heap):
              """Dump all available memory regions."""
              def dump_region(reader, start, size, location):
                print
                while start & 3 != 0:
            Severity: Minor
            Found in deps/v8/tools/grokdump.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 ClientRequest has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
            Open

            function ClientRequest(options, cb) {
              var self = this;
              OutgoingMessage.call(self);
            
              if (util.isString(options)) {
            Severity: Minor
            Found in lib/_http_client.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 WriteRules has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
            Open

              def WriteRules(self, rules, extra_sources, prebuild,
                             mac_bundle_resources, extra_mac_bundle_resources):
                env = self.GetSortedXcodeEnv()
                all_outputs = []
                for rule in rules:
            Severity: Minor
            Found in tools/gyp/pylib/gyp/generator/ninja.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 queueForRemoval has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
            Open

            def queueForRemoval(tree):
                global remove
                if not config.has_key("trees"):
                    # no config
                    return
            Severity: Minor
            Found in tools/icu/icutrim.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 Write has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
            Open

              def Write(self, writer=gyp.common.WriteOnDiff):
                """Writes the solution file to disk.
            
                Raises:
                  IndexError: An entry appears multiple times.
            Severity: Minor
            Found in tools/gyp/pylib/gyp/MSVSNew.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

            Severity
            Category
            Status
            Source
            Language