Showing 1,896 of 2,859 total issues

Function HandleToken has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
Open

  def HandleToken(self, token, last_non_space_token):
    """Handles the given token and updates state.

    Args:
      token: The token to handle.
Severity: Minor
Found in tools/closure_linter/closure_linter/statetracker.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 UpdateProperties has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
Open

  def UpdateProperties(self, properties, do_copy=False):
    """Merge the supplied properties into the _properties dictionary.

    The input properties must adhere to the class schema or a KeyError or
    TypeError exception will be raised.  If adding an object of an XCObject
Severity: Minor
Found in tools/gyp/pylib/gyp/xcodeproj_file.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 cluster.js has 519 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/cluster.js - About 1 day to fix

    File ecmalintrules.py has 518 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python
    #
    # Copyright 2008 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/ecmalintrules.py - About 1 day to fix

      Function MergeDicts has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
      Open

      def MergeDicts(to, fro, to_file, fro_file):
        # I wanted to name the parameter "from" but it's a Python keyword...
        for k, v in fro.iteritems():
          # It would be nice to do "if not k in to: to[k] = v" but that wouldn't give
          # copy semantics.  Something else may want to merge from the |fro| dict
      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

      Function createSecureContext has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
      Open

      exports.createSecureContext = function createSecureContext(options, context) {
        if (!options) options = {};
      
        var secureOptions = options.secureOptions;
        if (options.honorCipherOrder)
      Severity: Minor
      Found in lib/_tls_common.js - 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

      ScriptTest has 57 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class ScriptTest(unittest.TestCase):
        def MakeEmptyTempFile(self):
          handle, name = tempfile.mkstemp()
          os.close(handle)
          self._tmp_files.append(name)
      Severity: Major
      Found in deps/v8/tools/push-to-trunk/test_scripts.py - About 1 day to fix

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

          Function Main has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
          Open

          def Main():
            parser = BuildOptions()
            (options, args) = parser.parse_args()
            if not ProcessOptions(options):
              parser.print_help()
          Severity: Minor
          Found in tools/test.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 AnalyzeMinidump has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
          Open

          def AnalyzeMinidump(options, minidump_name):
            reader = MinidumpReader(options, minidump_name)
            heap = None
            DebugPrint("========================================")
            if reader.exception is None:
          Severity: Minor
          Found in deps/v8/tools/grokdump.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 complete has 200 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          REPLServer.prototype.complete = function(line, callback) {
            // There may be local variables to evaluate, try a nested REPL
            if (!util.isUndefined(this.bufferedCommand) && this.bufferedCommand.length) {
              // Get a new array of inputed lines
              var tmp = this.lines.slice();
          Severity: Major
          Found in lib/repl.js - About 1 day to fix

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

              Function resolveObject has 199 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Url.prototype.resolveObject = function(relative) {
                if (util.isString(relative)) {
                  var rel = new Url();
                  rel.parse(relative, false, true);
                  relative = rel;
              Severity: Major
              Found in lib/url.js - About 7 hrs to fix

                Function _ttyWrite has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                Open

                Interface.prototype._ttyWrite = function(s, key) {
                  key = key || {};
                
                  // Ignore escape key - Fixes #2876
                  if (key.name == 'escape') return;
                Severity: Minor
                Found in lib/readline.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 GenerateOutput has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                Open

                def GenerateOutput(target_list, target_dicts, data, params):
                  options = params['options']
                  flavor = gyp.common.GetFlavor(params)
                  generator_flags = params.get('generator_flags', {})
                  builddir_name = generator_flags.get('output_dir', 'out')
                Severity: Minor
                Found in tools/gyp/pylib/gyp/generator/make.py - About 7 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function REPLServer has 188 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined) {
                  if (!(this instanceof REPLServer)) {
                    return new REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined);
                  }
                
                
                Severity: Major
                Found in lib/repl.js - About 7 hrs to fix

                  File run-tests.py has 480 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  #!/usr/bin/env python
                  #
                  # Copyright 2012 the V8 project authors. All rights reserved.
                  # Redistribution and use in source and binary forms, with or without
                  # modification, are permitted provided that the following conditions are
                  Severity: Minor
                  Found in deps/v8/tools/run-tests.py - About 7 hrs to fix

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

                    def TextWrap(text, length=None, indent='', firstline_indent=None, tabs='    '):
                      """Wraps a given text to a maximum line length and returns it.
                    
                      We turn lines that only contain whitespaces into empty lines.  We keep
                      new lines and tabs (e.g., we do not treat tabs as spaces).
                    Severity: Minor
                    Found in tools/closure_linter/gflags.py - About 7 hrs to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

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

                      def Finalize1(self, xcode_targets, serialize_all_tests):
                        # Collect a list of all of the build configuration names used by the
                        # various targets in the file.  It is very heavily advised to keep each
                        # target in an entire project (even across multiple project files) using
                        # the same set of configuration names.
                    Severity: Minor
                    Found in tools/gyp/pylib/gyp/generator/xcode.py - About 7 hrs to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

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

                    def Execute(arch, mode, args, options, suites, workspace):
                      print(">>> Running tests for %s.%s" % (arch, mode))
                    
                      dist = Distribution(options)
                    
                    
                    Severity: Minor
                    Found in deps/v8/tools/run-deopt-fuzzer.py - About 7 hrs to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Severity
                    Category
                    Status
                    Source
                    Language