Showing 2,859 of 2,859 total issues

File _tls_wrap.js has 650 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright Joyent, Inc. and other Node contributors.
//
// // Emit `beforeExit` if the loop became alive either after emitting
// event, or after running some callbacks.
//
Severity: Major
Found in lib/_tls_wrap.js - About 1 day to fix

    Function FluidField has 285 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function FluidField(canvas) {
        function addFields(x, s, dt)
        {
            for (var i=0; i<size ; i++ ) x[i] += dt*s[i];
        }
    Severity: Major
    Found in deps/v8/benchmarks/navier-stokes.js - About 1 day to fix

      Function CheckLanguage has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
      Open

      def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state,
                        error):
        """Checks rules from the 'C++ language rules' section of cppguide.html.
      
        Some of these rules are hard to test (function overloading, using
      Severity: Minor
      Found in tools/cpplint.py - About 1 day 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 CheckSpacing has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
      Open

      def CheckSpacing(filename, clean_lines, linenum, error):
        """Checks for the correctness of various spacing issues in the code.
      
        Things we check for: spaces around operators, spaces after
        if/for/while/switch, no spaces around parens in function calls, two
      Severity: Minor
      Found in tools/cpplint.py - About 1 day 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 _tls_legacy.js has 625 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: Major
      Found in lib/_tls_legacy.js - About 1 day to fix

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

        def Execute(cmdline):
          (fd_out, outname) = tempfile.mkstemp()
          (fd_err, errname) = tempfile.mkstemp()
          process = subprocess.Popen(
            args=cmdline,
        Severity: Major
        Found in deps/v8/tools/nacl-run.py and 1 other location - About 1 day to fix
        deps/v8/tools/android-run.py on lines 49..67

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

        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 Execute(cmdline):
          (fd_out, outname) = tempfile.mkstemp()
          (fd_err, errname) = tempfile.mkstemp()
          process = subprocess.Popen(
            args=cmdline,
        Severity: Major
        Found in deps/v8/tools/android-run.py and 1 other location - About 1 day to fix
        deps/v8/tools/nacl-run.py on lines 44..62

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

        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

                 'VCLinkerTool': {
                     'AdditionalDependencies': 'file1;file2',
                     'AdditionalLibraryDirectories': 'folder1;folder2',
                     'AdditionalManifestDependencies': 'file1;file2',
                     'AdditionalOptions': 'a string1',
        Severity: Major
        Found in tools/gyp/pylib/gyp/MSVSSettings_test.py and 1 other location - About 1 day to fix
        tools/gyp/pylib/gyp/MSVSSettings_test.py on lines 1197..1275

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

        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

                'VCLinkerTool': {
                    'AdditionalDependencies': 'zx',
                    'AdditionalLibraryDirectories': 'asd',
                    'AdditionalManifestDependencies': 's2',
                    'AdditionalOptions': '/mor2',
        Severity: Major
        Found in tools/gyp/pylib/gyp/MSVSSettings_test.py and 1 other location - About 1 day to fix
        tools/gyp/pylib/gyp/MSVSSettings_test.py on lines 110..187

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

        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 _stream_readable.js has 608 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: Major
        Found in lib/_stream_readable.js - About 1 day to fix

          Function ProcessListFiltersInDict has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
          Open

          def ProcessListFiltersInDict(name, the_dict):
            """Process regular expression and exclusion-based filters on lists.
          
            An exclusion list is in a dict key named with a trailing "!", like
            "sources!".  Every item in such a list is removed from the associated
          Severity: Minor
          Found in tools/gyp/pylib/gyp/input.py - About 1 day 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

              while end < len(lines) and height > 0:
                # We don't count commas at higher nesting levels.
                if lines[end] == ',' and height == 1:
                  add_arg(lines[last_match:end])
                  last_match = end + 1
          Severity: Major
          Found in deps/v8/tools/js2c.py and 1 other location - About 1 day to fix
          tools/js2c.py on lines 138..147

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

          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

                while end < len(lines) and height > 0:
                  # We don't count commas at higher nesting levels.
                  if lines[end] == ',' and height == 1:
                    add_arg(lines[last_match:end])
                    last_match = end + 1
          Severity: Major
          Found in tools/js2c.py and 1 other location - About 1 day to fix
          deps/v8/tools/js2c.py on lines 107..116

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

          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

          SplayTree.prototype.insert = function(key, value) {
            if (this.isEmpty()) {
              this.root_ = new SplayTree.Node(key, value);
              return;
            }
          Severity: Major
          Found in deps/v8/tools/splaytree.js and 2 other locations - About 1 day to fix
          deps/v8/benchmarks/spinning-balls/splay-tree.js on lines 65..87
          deps/v8/benchmarks/splay.js on lines 160..182

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

          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

          SplayTree.prototype.insert = function(key, value) {
            if (this.isEmpty()) {
              this.root_ = new SplayTree.Node(key, value);
              return;
            }
          Severity: Major
          Found in deps/v8/benchmarks/spinning-balls/splay-tree.js and 2 other locations - About 1 day to fix
          deps/v8/benchmarks/splay.js on lines 160..182
          deps/v8/tools/splaytree.js on lines 67..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 246.

          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

          SplayTree.prototype.insert = function(key, value) {
            if (this.isEmpty()) {
              this.root_ = new SplayTree.Node(key, value);
              return;
            }
          Severity: Major
          Found in deps/v8/benchmarks/splay.js and 2 other locations - About 1 day to fix
          deps/v8/benchmarks/spinning-balls/splay-tree.js on lines 65..87
          deps/v8/tools/splaytree.js on lines 67..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 246.

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

          def GenerateOutputForConfig(target_list, target_dicts, data, params,
                                      config_name):
            options = params['options']
            flavor = gyp.common.GetFlavor(params)
            generator_flags = params.get('generator_flags', {})
          Severity: Minor
          Found in tools/gyp/pylib/gyp/generator/ninja.py - About 1 day 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 _ProcessContext has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
          Open

            def _ProcessContext(self):
              """Process the context at the current token.
          
              Returns:
                The context that should be assigned to the current token, or None if
          Severity: Minor
          Found in tools/closure_linter/closure_linter/ecmametadatapass.py - About 1 day 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 WriteLinkForArch has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
          Open

            def WriteLinkForArch(self, ninja_file, spec, config_name, config,
                                 link_deps, arch=None):
              """Write out a link step. Fills out target.binary. """
              command = {
                'executable':      'link',
          Severity: Minor
          Found in tools/gyp/pylib/gyp/generator/ninja.py - About 1 day 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

            if heap.reader.arch == MD_CPU_ARCHITECTURE_X86:
              if code.startswith("e8"):
                words = code.split()
                if len(words) > 6 and words[5] == "call":
                  offset = int(words[4] + words[3] + words[2] + words[1], 16)
          Severity: Major
          Found in deps/v8/tools/grokdump.py and 1 other location - About 1 day to fix
          deps/v8/tools/grokdump.py on lines 2514..2520

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

          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