deps/v8/tools/tickprocessor.js

Summary

Maintainability
F
5 days
Test Coverage

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

    Function TickProcessor has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function TickProcessor(
        cppEntriesProvider,
        separateIc,
        callGraphSize,
        ignoreUnknown,
    Severity: Major
    Found in deps/v8/tools/tickprocessor.js - About 2 hrs to fix

      Function printStatistics has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      TickProcessor.prototype.printStatistics = function() {
        print('Statistical profiling result from ' + this.lastLogFileName_ +
              ', (' + this.ticks_.total +
              ' ticks, ' + this.ticks_.unaccounted + ' unaccounted, ' +
              this.ticks_.excluded + ' excluded).');
      Severity: Minor
      Found in deps/v8/tools/tickprocessor.js - About 1 hr to fix

        Function parseVmSymbols has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

        CppEntriesProvider.prototype.parseVmSymbols = function(
            libName, libStart, libEnd, processorFunc) {
          this.loadSymbols(libName);
        
          var prevEntry;
        Severity: Minor
        Found in deps/v8/tools/tickprocessor.js - About 1 hr 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 ArgumentsProcessor has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function ArgumentsProcessor(args) {
          this.args_ = args;
          this.result_ = ArgumentsProcessor.DEFAULTS;
        
          this.argsDispatch_ = {
        Severity: Minor
        Found in deps/v8/tools/tickprocessor.js - About 1 hr to fix

          Function parse has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          ArgumentsProcessor.prototype.parse = function() {
            while (this.args_.length) {
              var arg = this.args_[0];
              if (arg.charAt(0) != '-') {
                break;
          Severity: Minor
          Found in deps/v8/tools/tickprocessor.js - About 1 hr 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 parseVmSymbols has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          CppEntriesProvider.prototype.parseVmSymbols = function(
              libName, libStart, libEnd, processorFunc) {
            this.loadSymbols(libName);
          
            var prevEntry;
          Severity: Minor
          Found in deps/v8/tools/tickprocessor.js - About 1 hr to fix

            Function SnapshotLogProcessor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function SnapshotLogProcessor() {
              LogReader.call(this, {
                  'code-creation': {
                      parsers: [null, parseInt, parseInt, parseInt, null, 'var-args'],
                      processor: this.processCodeCreation },
            Severity: Minor
            Found in deps/v8/tools/tickprocessor.js - About 1 hr to fix

              Function TickProcessor has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  cppEntriesProvider,
                  separateIc,
                  callGraphSize,
                  ignoreUnknown,
                  stateFilter,
              Severity: Major
              Found in deps/v8/tools/tickprocessor.js - About 1 hr to fix

                Function TickProcessor has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                function TickProcessor(
                    cppEntriesProvider,
                    separateIc,
                    callGraphSize,
                    ignoreUnknown,
                Severity: Minor
                Found in deps/v8/tools/tickprocessor.js - About 55 mins 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 printUsageAndExit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                ArgumentsProcessor.prototype.printUsageAndExit = function() {
                
                  function padRight(s, len) {
                    s = s.toString();
                    if (s.length < len) {
                Severity: Minor
                Found in deps/v8/tools/tickprocessor.js - About 55 mins 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 processTick has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                TickProcessor.prototype.processTick = function(pc,
                                                               ns_since_start,
                                                               is_external_callback,
                                                               tos_or_external_callback,
                                                               vmState,
                Severity: Minor
                Found in deps/v8/tools/tickprocessor.js - About 45 mins to fix

                  Function processCodeCreation has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      type, kind, start, size, name, maybe_func) {
                  Severity: Minor
                  Found in deps/v8/tools/tickprocessor.js - About 45 mins to fix

                    Function processCodeCreation has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        type, kind, start, size, name, maybe_func) {
                    Severity: Minor
                    Found in deps/v8/tools/tickprocessor.js - About 45 mins to fix

                      Function printEntries has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          profile, totalTicks, nonLibTicks, filterP, callback) {
                      Severity: Minor
                      Found in deps/v8/tools/tickprocessor.js - About 35 mins to fix

                        Function processTick has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        TickProcessor.prototype.processTick = function(pc,
                                                                       ns_since_start,
                                                                       is_external_callback,
                                                                       tos_or_external_callback,
                                                                       vmState,
                        Severity: Minor
                        Found in deps/v8/tools/tickprocessor.js - About 35 mins 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 parseNextLine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        UnixCppEntriesProvider.prototype.parseNextLine = function() {
                          if (this.symbols.length == 0) {
                            return false;
                          }
                          var lineEndPos = this.symbols[0].indexOf('\n', this.parsePos);
                        Severity: Minor
                        Found in deps/v8/tools/tickprocessor.js - About 25 mins 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 (maybe_func.length) {
                            var funcAddr = parseInt(maybe_func[0]);
                            var state = parseState(maybe_func[1]);
                            this.profile_.addFuncCode(type, name, start, size, funcAddr, state);
                          } else {
                        Severity: Major
                        Found in deps/v8/tools/tickprocessor.js and 1 other location - About 2 hrs to fix
                        deps/v8/tools/tickprocessor.js on lines 111..117

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

                        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

                          if (maybe_func.length) {
                            var funcAddr = parseInt(maybe_func[0]);
                            var state = parseState(maybe_func[1]);
                            this.profile_.addFuncCode(type, name, start, size, funcAddr, state);
                          } else {
                        Severity: Major
                        Found in deps/v8/tools/tickprocessor.js and 1 other location - About 2 hrs to fix
                        deps/v8/tools/tickprocessor.js on lines 333..339

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

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

                          producersView.sort(function(rec1, rec2) {
                              return rec2.totalTime - rec1.totalTime ||
                                  (rec2.internalFuncName < rec1.internalFuncName ? -1 : 1); });
                        Severity: Major
                        Found in deps/v8/tools/tickprocessor.js and 2 other locations - About 1 hr to fix
                        deps/v8/tools/tickprocessor.js on lines 447..449
                        deps/v8/tools/tickprocessor.js on lines 494..496

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

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

                          heavyView.sort(function(rec1, rec2) {
                              return rec2.totalTime - rec1.totalTime ||
                                  (rec2.internalFuncName < rec1.internalFuncName ? -1 : 1); });
                        Severity: Major
                        Found in deps/v8/tools/tickprocessor.js and 2 other locations - About 1 hr to fix
                        deps/v8/tools/tickprocessor.js on lines 426..428
                        deps/v8/tools/tickprocessor.js on lines 447..449

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

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

                          flatView.sort(function(rec1, rec2) {
                              return rec2.selfTime - rec1.selfTime ||
                                  (rec2.internalFuncName < rec1.internalFuncName ? -1 : 1); });
                        Severity: Major
                        Found in deps/v8/tools/tickprocessor.js and 2 other locations - About 1 hr to fix
                        deps/v8/tools/tickprocessor.js on lines 426..428
                        deps/v8/tools/tickprocessor.js on lines 494..496

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

                        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

                          this.printEntries(flatViewNodes, totalTicks, nonLibraryTicks,
                              function(name) { return self.isJsCode(name); },
                              function(rec) { jsTicks += rec.selfTime; });
                        Severity: Minor
                        Found in deps/v8/tools/tickprocessor.js and 1 other location - About 40 mins to fix
                        deps/v8/tools/tickprocessor.js on lines 474..476

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

                        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

                          this.printEntries(flatViewNodes, totalTicks, nonLibraryTicks,
                              function(name) { return self.isCppCode(name); },
                              function(rec) { cppTicks += rec.selfTime; });
                        Severity: Minor
                        Found in deps/v8/tools/tickprocessor.js and 1 other location - About 40 mins to fix
                        deps/v8/tools/tickprocessor.js on lines 468..470

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

                        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 (eqPos != -1) {
                              userValue = arg.substr(eqPos + 1);
                              arg = arg.substr(0, eqPos);
                            }
                        Severity: Minor
                        Found in deps/v8/tools/tickprocessor.js and 1 other location - About 40 mins to fix
                        tools/doc/json.js on lines 311..314

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

                        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

                        There are no issues that match your filters.

                        Category
                        Status