Showing 2,689 issues of 2,689 total

File ll_prof.py has 803 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: Major
Found in deps/v8/tools/ll_prof.py - About 1 day to fix

    Function gyp_main has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
    Open

    def gyp_main(args):
      my_name = os.path.basename(sys.argv[0])
    
      parser = RegeneratableOptionParser()
      usage = 'usage: %s [options ...] [build_file ...]'
    Severity: Minor
    Found in tools/gyp/pylib/gyp/__init__.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 Sodium has 349 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var Sodium = (function() {
      "use strict";
    
      var kinds = ["FUNCTION", "OPTIMIZED_FUNCTION", "STUB", "BUILTIN",
                   "LOAD_IC", "KEYED_LOAD_IC", "CALL_IC", "KEYED_CALL_IC",
    Severity: Major
    Found in deps/v8/tools/sodium/sodium.js - About 1 day to fix

      File android.py has 746 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # Copyright (c) 2012 Google Inc. All rights reserved.
      # Use of this source code is governed by a BSD-style license that can be
      # found in the LICENSE file.
      
      # Notes:
      Severity: Major
      Found in tools/gyp/pylib/gyp/generator/android.py - About 1 day to fix

        Function testConvertToMSBuildSettings_actual has 347 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def testConvertToMSBuildSettings_actual(self):
            """Tests the conversion of an actual project.
        
            A VS2008 project with most of the options defined was created through the
            VS2008 IDE.  It was then converted to VS2010.  The tool settings found in
        Severity: Major
        Found in tools/gyp/pylib/gyp/MSVSSettings_test.py - About 1 day to fix

          Function CheckToken has 344 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def CheckToken(self, token, state):
              """Checks a token, given the current parser_state, for warnings and errors.
          
              Args:
                token: The current token under consideration
          Severity: Major
          Found in tools/closure_linter/closure_linter/ecmalintrules.py - About 1 day to fix

            Function WriteTarget has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
            Open

              def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
                              extra_outputs, part_of_all):
                """Write Makefile code to produce the final target of the gyp spec.
            
                spec, configs: input from gyp.
            Severity: Minor
            Found in tools/gyp/pylib/gyp/generator/make.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 CheckToken has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
            Open

              def CheckToken(self, token, state):
                """Checks a token for indentation errors.
            
                Args:
                  token: The current token under consideration
            Severity: Minor
            Found in tools/closure_linter/closure_linter/indentation.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 buffer.js has 718 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/buffer.js - About 1 day to fix

              File tickprocessor.js has 713 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              // 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
              // met:
              //
              Severity: Major
              Found in deps/v8/tools/tickprocessor.js - About 1 day to fix

                File statetracker.py has 709 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                #!/usr/bin/env python
                #
                # Copyright 2007 The Closure Linter Authors. All Rights Reserved.
                #
                # Licensed under the Apache License, Version 2.0 (the "License");
                Severity: Major
                Found in tools/closure_linter/closure_linter/statetracker.py - About 1 day to fix

                  Function DebugResponseDetails has 311 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function DebugResponseDetails(response) {
                    var details = { text: '', running: false };
                  
                    try {
                      if (!response.success()) {
                  Severity: Major
                  Found in deps/v8/src/d8.js - About 1 day to fix

                    File repl.js has 671 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/repl.js - About 1 day to fix

                      File raytrace.js has 670 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      // The ray tracer code in this file is written by Adam Burmister. It
                      // is available in its original form from:
                      //
                      //   http://labs.flog.nz.co/raytracer/
                      //
                      Severity: Major
                      Found in deps/v8/benchmarks/raytrace.js - About 1 day to fix

                        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 testValidateMSBuildSettings_settings has 276 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def testValidateMSBuildSettings_settings(self):
                                """Tests that for invalid MSBuild settings."""
                                MSVSSettings.ValidateMSBuildSettings(
                                    {'ClCompile': {
                                        'AdditionalIncludeDirectories': 'folder1;folder2',
                            Severity: Major
                            Found in tools/gyp/pylib/gyp/MSVSSettings_test.py - About 1 day to fix

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

                                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

                                Severity
                                Category
                                Status