Showing 2,859 of 2,859 total issues

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

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

  def test_no_cycle_line(self):
    self._create_dependency(self.nodes['a'], self.nodes['b'])
    self._create_dependency(self.nodes['b'], self.nodes['c'])
    self._create_dependency(self.nodes['c'], self.nodes['d'])

Severity: Major
Found in tools/gyp/pylib/gyp/input_test.py and 1 other location - About 7 hrs to fix
tools/gyp/pylib/gyp/input_test.py on lines 36..42

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

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

  def test_no_cycle_dag(self):
    self._create_dependency(self.nodes['a'], self.nodes['b'])
    self._create_dependency(self.nodes['a'], self.nodes['c'])
    self._create_dependency(self.nodes['b'], self.nodes['c'])

Severity: Major
Found in tools/gyp/pylib/gyp/input_test.py and 1 other location - About 7 hrs to fix
tools/gyp/pylib/gyp/input_test.py on lines 28..34

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

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

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

      if (uconfKeys.length) {
        msg += "; userconfig " + npm.config.get("userconfig") + "\n"
        uconfKeys.forEach(function (k) {
          var val = (k.charAt(0) === "_")
                  ? "---sekretz---"
    Severity: Major
    Found in deps/npm/lib/config.js and 1 other location - About 7 hrs to fix
    deps/npm/lib/config.js on lines 218..231

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

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

      if (gconfKeys.length) {
        msg += "; globalconfig " + npm.config.get("globalconfig") + "\n"
        gconfKeys.forEach(function (k) {
          var val = (k.charAt(0) === "_")
                  ? "---sekretz---"
    Severity: Major
    Found in deps/npm/lib/config.js and 1 other location - About 7 hrs to fix
    deps/npm/lib/config.js on lines 200..213

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

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

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

          def ShardTests(tests, shard_count, shard_run):
            if shard_count < 2:
              return tests
            if shard_run < 1 or shard_run > shard_count:
              print "shard-run not a valid number, should be in [1:shard-count]"
          Severity: Major
          Found in deps/v8/tools/run-tests.py and 1 other location - About 6 hrs to fix
          deps/v8/tools/run-deopt-fuzzer.py on lines 271..284

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

          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

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

          def ShardTests(tests, shard_count, shard_run):
            if shard_count < 2:
              return tests
            if shard_run < 1 or shard_run > shard_count:
              print "shard-run not a valid number, should be in [1:shard-count]"
          Severity: Major
          Found in deps/v8/tools/run-deopt-fuzzer.py and 1 other location - About 6 hrs to fix
          deps/v8/tools/run-tests.py on lines 374..387

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

          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

          Function parse has 170 lines of code (exceeds 25 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: Major
          Found in lib/url.js - About 6 hrs to fix

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

            function main(conf) {
              dur = +conf.dur;
              len = +conf.len;
              type = conf.type;
            
            
            Severity: Major
            Found in benchmark/net/net-pipe.js and 2 other locations - About 6 hrs to fix
            benchmark/net/net-c2s.js on lines 18..42
            benchmark/net/net-s2c.js on lines 18..42

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

            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

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

            function main(conf) {
              dur = +conf.dur;
              len = +conf.len;
              type = conf.type;
            
            
            Severity: Major
            Found in benchmark/net/net-s2c.js and 2 other locations - About 6 hrs to fix
            benchmark/net/net-c2s.js on lines 18..42
            benchmark/net/net-pipe.js on lines 18..42

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

            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

            Severity
            Category
            Status
            Source
            Language