Showing 2,859 of 2,859 total issues

Function ExpandWildcardDependencies has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

def ExpandWildcardDependencies(targets, data):
  """Expands dependencies specified as build_file:*.

  For each target in |targets|, examines sections containing links to other
  targets.  If any such section contains a link of the form build_file:*, it
Severity: Minor
Found in tools/gyp/pylib/gyp/input.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 has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

def Load(build_files, variables, includes, depth, generator_input_info, check,
         circular_check, parallel, root_targets):
  SetGeneratorGlobals(generator_input_info)
  # A generator can have other lists (in addition to sources) be processed
  # for rules.
Severity: Minor
Found in tools/gyp/pylib/gyp/input.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 ProcessOptions has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

def ProcessOptions(options):
  global VARIANT_FLAGS
  global VARIANTS

  # Architecture and mode related stuff.
Severity: Minor
Found in deps/v8/tools/run-tests.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 RunFuzzer has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

def RunFuzzer(process_id, options, stop_running):
  MAX_SLEEP_TIME = 0.1
  INITIAL_SLEEP_TIME = 0.001
  SLEEP_TIME_FACTOR = 1.25
  base_file_name = "/dev/shm/runtime_fuzz_%d" % process_id
Severity: Minor
Found in deps/v8/tools/generate-runtime-tests.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 gunzTarPerm has 131 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) {
  if (!dMode) dMode = npm.modes.exec
  if (!fMode) fMode = npm.modes.file
  log.silly("gunzTarPerm", "modes", [dMode.toString(8), fMode.toString(8)])

Severity: Major
Found in deps/npm/lib/utils/tar.js - About 5 hrs to fix

    File json.js has 382 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 tools/doc/json.js - About 5 hrs to fix

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

        switch (conf.type) {
          case 'asc':
            message = new Array(conf.len + 1).join('a');
            encoding = 'ascii';
            break;
      Severity: Major
      Found in benchmark/crypto/hash-stream-throughput.js and 2 other locations - About 5 hrs to fix
      benchmark/crypto/cipher-stream.js on lines 40..55
      benchmark/crypto/hash-stream-creation.js on lines 28..43

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

      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

        switch (conf.type) {
          case 'asc':
            message = new Array(conf.len + 1).join('a');
            encoding = 'ascii';
            break;
      Severity: Major
      Found in benchmark/crypto/cipher-stream.js and 2 other locations - About 5 hrs to fix
      benchmark/crypto/hash-stream-creation.js on lines 28..43
      benchmark/crypto/hash-stream-throughput.js on lines 27..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 138.

      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

        switch (conf.type) {
          case 'asc':
            message = new Array(conf.len + 1).join('a');
            encoding = 'ascii';
            break;
      Severity: Major
      Found in benchmark/crypto/hash-stream-creation.js and 2 other locations - About 5 hrs to fix
      benchmark/crypto/cipher-stream.js on lines 40..55
      benchmark/crypto/hash-stream-throughput.js on lines 27..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 138.

      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 makeEnv has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

      function makeEnv (data, prefix, env) {
        prefix = prefix || "npm_package_"
        if (!env) {
          env = {}
          for (var i in process.env) if (!i.match(/^npm_/)) {
      Severity: Minor
      Found in deps/npm/lib/utils/lifecycle.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 gunzTarPerm has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

      function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) {
        if (!dMode) dMode = npm.modes.exec
        if (!fMode) fMode = npm.modes.file
        log.silly("gunzTarPerm", "modes", [dMode.toString(8), fMode.toString(8)])
      
      
      Severity: Minor
      Found in deps/npm/lib/utils/tar.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

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

          while(u.isEven()) {
            u.rShiftTo(1,u);
            if(ac) {
              if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
              a.rShiftTo(1,a);
      Severity: Major
      Found in deps/v8/benchmarks/crypto.js and 1 other location - About 5 hrs to fix
      deps/v8/benchmarks/crypto.js on lines 1212..1220

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

      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

          while(v.isEven()) {
            v.rShiftTo(1,v);
            if(ac) {
              if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
              c.rShiftTo(1,c);
      Severity: Major
      Found in deps/v8/benchmarks/crypto.js and 1 other location - About 5 hrs to fix
      deps/v8/benchmarks/crypto.js on lines 1203..1211

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

      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 run-deopt-fuzzer.py has 377 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-deopt-fuzzer.py - About 5 hrs to fix

        MsvsSettings has 38 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class MsvsSettings(object):
          """A class that understands the gyp 'msvs_...' values (especially the
          msvs_settings field). They largely correpond to the VS2008 IDE DOM. This
          class helps map those settings to command line options."""
        
        
        Severity: Minor
        Found in tools/gyp/pylib/gyp/msvs_emulation.py - About 5 hrs to fix

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

            if reverse:
              while token and (distance is None or distance > 0):
                previous = token.previous
                if previous:
                  if func(previous):
          Severity: Major
          Found in tools/closure_linter/closure_linter/tokenutil.py and 1 other location - About 5 hrs to fix
          tools/closure_linter/closure_linter/tokenutil.py on lines 65..89

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

          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 SetTargetProperty(output, target_name, property_name, values, sep=''):
            """Given a target, sets the given property."""
            output.write('set_target_properties(')
            output.write(target_name)
            output.write(' PROPERTIES ')
          Severity: Major
          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 5 hrs to fix
          tools/gyp/pylib/gyp/generator/cmake.py on lines 140..150

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

          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 SetFileProperty(output, source_name, property_name, values, sep):
            """Given a set of source file, sets the given property on them."""
            output.write('set_source_files_properties(')
            output.write(source_name)
            output.write(' PROPERTIES ')
          Severity: Major
          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 5 hrs to fix
          tools/gyp/pylib/gyp/generator/cmake.py on lines 169..179

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

          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 MergeLists has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
          Open

          def MergeLists(to, fro, to_file, fro_file, is_paths=False, append=True):
            # Python documentation recommends objects which do not support hash
            # set this value to None. Python library objects follow this rule.
            is_hashable = lambda val: val.__hash__
          
          
          Severity: Minor
          Found in tools/gyp/pylib/gyp/input.py - About 4 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 ProcessContents has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
          Open

            def ProcessContents(self, name, contents):
              result = True
              base = basename(name)
              if not base in SourceProcessor.IGNORE_TABS:
                if '\t' in contents:
          Severity: Minor
          Found in deps/v8/tools/presubmit.py - About 4 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