enclose-io/compiler

View on GitHub
current/deps/v8/tools/profview/profile-utils.js

Summary

Maintainability
F
1 mo
Test Coverage

File profile-utils.js has 508 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

"use strict";
Severity: Major
Found in current/deps/v8/tools/profview/profile-utils.js - About 1 day to fix

    Function computeOptimizationStats has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    function computeOptimizationStats(file,
        timeStart = -Infinity, timeEnd = Infinity) {
      function newCollection() {
        return { count : 0, functions : [], functionTable : [] };
      }
    Severity: Minor
    Found in current/deps/v8/tools/profview/profile-utils.js - 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 addStack has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

      addStack(file, tickIndex) {
        let stack = file.ticks[tickIndex].s;
        let vmState = file.ticks[tickIndex].vm;
    
        this.tree.ticks++;
    Severity: Minor
    Found in current/deps/v8/tools/profview/profile-utils.js - About 3 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 computeOptimizationStats has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function computeOptimizationStats(file,
        timeStart = -Infinity, timeEnd = Infinity) {
      function newCollection() {
        return { count : 0, functions : [], functionTable : [] };
      }
    Severity: Major
    Found in current/deps/v8/tools/profview/profile-utils.js - About 3 hrs to fix

      Function addStack has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

        addStack(file, tickIndex) {
          if (!this.functionCodeId) return;
      
          let { tm : timestamp, vm : vmState, s : stack } = file.ticks[tickIndex];
          let functionCode = file.code[this.functionCodeId];
      Severity: Minor
      Found in current/deps/v8/tools/profview/profile-utils.js - About 2 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 resolveCodeKind has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      function resolveCodeKind(code) {
        if (!code || !code.type) {
          return "UNKNOWN";
        } else if (code.type === "CPP") {
          return "CPP";
      Severity: Minor
      Found in current/deps/v8/tools/profview/profile-utils.js - About 2 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 addStack has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        addStack(file, tickIndex) {
          let stack = file.ticks[tickIndex].s;
          let vmState = file.ticks[tickIndex].vm;
      
          this.tree.ticks++;
      Severity: Major
      Found in current/deps/v8/tools/profview/profile-utils.js - About 2 hrs to fix

        Function findNextFrame has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function findNextFrame(file, stack, stackPos, step, filter) {
          let codeId = -1;
          let code = null;
          while (stackPos >= 0 && stackPos < stack.length) {
            codeId = stack[stackPos];
        Severity: Minor
        Found in current/deps/v8/tools/profview/profile-utils.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 addStack has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          addStack(file, tickIndex) {
            if (!this.functionCodeId) return;
        
            let { tm : timestamp, vm : vmState, s : stack } = file.ticks[tickIndex];
            let functionCode = file.code[this.functionCodeId];
        Severity: Minor
        Found in current/deps/v8/tools/profview/profile-utils.js - About 1 hr to fix

          Function resolveCodeKind has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function resolveCodeKind(code) {
            if (!code || !code.type) {
              return "UNKNOWN";
            } else if (code.type === "CPP") {
              return "CPP";
          Severity: Minor
          Found in current/deps/v8/tools/profview/profile-utils.js - About 1 hr to fix

            Function codeEquals has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            function codeEquals(code1, code2, allowDifferentKinds = false) {
              if (!code1 || !code2) return false;
              if (code1.name !== code2.name || code1.type !== code2.type) return false;
            
              if (code1.type === 'CODE') {
            Severity: Minor
            Found in current/deps/v8/tools/profview/profile-utils.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

            Avoid deeply nested control flow statements.
            Open

                      switch (code.deopt.bailoutType) {
                        case "lazy":
                          addToCollection(lazyDeoptimizations, code);
                          break;
                        case "eager":
            Severity: Major
            Found in current/deps/v8/tools/profview/profile-utils.js - About 45 mins to fix

              Consider simplifying this complex logical expression.
              Open

                  if (code.kind === "LoadIC" ||
                      code.kind === "StoreIC" ||
                      code.kind === "KeyedStoreIC" ||
                      code.kind === "KeyedLoadIC" ||
                      code.kind === "LoadGlobalIC" ||
              Severity: Major
              Found in current/deps/v8/tools/profview/profile-utils.js - About 40 mins to fix

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

                function findNextFrame(file, stack, stackPos, step, filter) {
                Severity: Minor
                Found in current/deps/v8/tools/profview/profile-utils.js - About 35 mins to fix

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

                  function addOrUpdateChildNode(parent, file, stackIndex, stackPos, ascending) {
                  Severity: Minor
                  Found in current/deps/v8/tools/profview/profile-utils.js - About 35 mins to fix

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

                    function resolveCodeKindAndVmState(code, vmState) {
                      let kind = resolveCodeKind(code);
                      if (kind === "CPP") {
                        if (vmState === 1) {
                          kind = "CPPGC";
                    Severity: Minor
                    Found in current/deps/v8/tools/profview/profile-utils.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 addStack has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                      addStack(file, tickIndex) {
                        this.tree.ticks++;
                    
                        let stack = file.ticks[tickIndex].s;
                        let i;
                    Severity: Minor
                    Found in current/deps/v8/tools/profview/profile-utils.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

                    Avoid too many return statements within this function.
                    Open

                          return "BUILTIN";
                    Severity: Major
                    Found in current/deps/v8/tools/profview/profile-utils.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          if (code1.func !== code2.func) return false;
                      Severity: Major
                      Found in current/deps/v8/tools/profview/profile-utils.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return "STUB";
                        Severity: Major
                        Found in current/deps/v8/tools/profview/profile-utils.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return "CODE";
                          Severity: Major
                          Found in current/deps/v8/tools/profview/profile-utils.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return "JSUNOPT";
                            Severity: Major
                            Found in current/deps/v8/tools/profview/profile-utils.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return "JSOPT";
                              Severity: Major
                              Found in current/deps/v8/tools/profview/profile-utils.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return "BC";
                                Severity: Major
                                Found in current/deps/v8/tools/profview/profile-utils.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                    return true;
                                  Severity: Major
                                  Found in current/deps/v8/tools/profview/profile-utils.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                          return "JSUNOPT";
                                    Severity: Major
                                    Found in current/deps/v8/tools/profview/profile-utils.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                            return "REGEXP";
                                      Severity: Major
                                      Found in current/deps/v8/tools/profview/profile-utils.js - About 30 mins to fix

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

                                        class FunctionListTree {
                                          constructor(filter, withCategories) {
                                            if (withCategories) {
                                              let { categories, root } = buildCategoryTreeAndLookup();
                                              this.tree = root;
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 4 days to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 312..383

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

                                        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

                                        function computeOptimizationStats(file,
                                            timeStart = -Infinity, timeEnd = Infinity) {
                                          function newCollection() {
                                            return { count : 0, functions : [], functionTable : [] };
                                          }
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 4 days to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 511..599

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

                                        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

                                        class FunctionTimelineProcessor {
                                          constructor(functionCodeId, filter) {
                                            this.functionCodeId = functionCodeId;
                                            this.filter = filter;
                                            this.blocks = [];
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 2 days to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 421..487

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

                                        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

                                        class CategorySampler {
                                          constructor(file, bucketCount) {
                                            this.bucketCount = bucketCount;
                                        
                                            this.firstTime = file.ticks[0].tm;
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 2 days to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 386..419

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

                                        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

                                        function resolveCodeKind(code) {
                                          if (!code || !code.type) {
                                            return "UNKNOWN";
                                          } else if (code.type === "CPP") {
                                            return "CPP";
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 2 days to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 25..61

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

                                        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

                                        class CategorizedCallTreeProcessor {
                                          constructor(filter, isBottomUp) {
                                            this.filter = filter;
                                            let { categories, root } = buildCategoryTreeAndLookup();
                                        
                                        
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 1 day to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 282..310

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

                                        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

                                        function addOrUpdateChildNode(parent, file, stackIndex, stackPos, ascending) {
                                          if (stackPos === -1) {
                                            // We reached the end without finding the next step.
                                            // If we are doing top-down call tree, update own ticks.
                                            if (!ascending) {
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 1 day to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 151..176

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

                                        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

                                        function buildCategoryTreeAndLookup() {
                                          let root = createEmptyNode("root");
                                          let categories = {};
                                          function addCategory(name, types) {
                                            let n = createEmptyNode(name);
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 1 day to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 256..280

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

                                        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

                                        class RuntimeCallTreeProcessor {
                                          constructor() {
                                            this.tree = createEmptyNode("root");
                                            this.tree.delayedExpansion = { frameList : [], ascending : false };
                                          }
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 1 day to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 211..234

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

                                        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

                                        function expandTreeNode(file, node, filter) {
                                          let { frameList, ascending } = node.delayedExpansion;
                                        
                                          let step = ascending ? 2 : -2;
                                        
                                        
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 1 day to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 179..198

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

                                        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

                                        class PlainCallTreeProcessor {
                                          constructor(filter, isBottomUp) {
                                            this.filter = filter;
                                            this.tree = createEmptyNode("root");
                                            this.tree.delayedExpansion = { frameList : [], ascending : isBottomUp };
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 1 day to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 236..254

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

                                        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

                                        function codeEquals(code1, code2, allowDifferentKinds = false) {
                                          if (!code1 || !code2) return false;
                                          if (code1.name !== code2.name || code1.type !== code2.type) return false;
                                        
                                          if (code1.type === 'CODE') {
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 6 hrs to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 81..92

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

                                        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

                                        function findNextFrame(file, stack, stackPos, step, filter) {
                                          let codeId = -1;
                                          let code = null;
                                          while (stackPos >= 0 && stackPos < stack.length) {
                                            codeId = stack[stackPos];
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 5 hrs to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 134..149

                                        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

                                        function generateTree(
                                            file, startTime, endTime, tree) {
                                          let ticks = file.ticks;
                                          let i = 0;
                                          while (i < ticks.length && ticks[i].tm < startTime) {
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 4 hrs to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 493..509

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

                                        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

                                        function resolveCodeKindAndVmState(code, vmState) {
                                          let kind = resolveCodeKind(code);
                                          if (kind === "CPP") {
                                            if (vmState === 1) {
                                              kind = "CPPGC";
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 4 hrs to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 63..79

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

                                        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

                                        function normalizeLeadingWhitespace(lines) {
                                          let regex = /^\s*/;
                                          let minimumLeadingWhitespaceChars = Infinity;
                                          for (let line of lines) {
                                            minimumLeadingWhitespaceChars =
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 4 hrs to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 601..611

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

                                        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

                                        function addFrameToFrameList(paths, pathIndex, depth) {
                                          // Try to combine with the previous code run.
                                          if (paths.length > 0 &&
                                              paths[paths.length - 3] + 1 === pathIndex &&
                                              paths[paths.length - 2] === depth) {
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 3 hrs to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 123..132

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

                                        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

                                        function childIdFromCode(codeId, code) {
                                          // For JavaScript function, pretend there is one instance of optimized
                                          // function and one instance of unoptimized function per SFI.
                                          // Otherwise, just compute the id from code id.
                                          let type = resolveCodeKind(code);
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 3 hrs to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 102..114

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

                                        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

                                        function createNodeFromStackEntry(code, codeId, vmState) {
                                          let name = code ? code.name : "UNKNOWN";
                                          let node = createEmptyNode(name);
                                          node.codeId = codeId;
                                          node.type = resolveCodeKindAndVmState(code, vmState);
                                        Severity: Major
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 1 hr to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 94..100

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

                                        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

                                        function createEmptyNode(name) {
                                          return {
                                              name : name,
                                              codeId: -1,
                                              type : "CAT",
                                        Severity: Minor
                                        Found in current/deps/v8/tools/profview/profile-utils.js and 1 other location - About 35 mins to fix
                                        lts/deps/v8/tools/profview/profile-utils.js on lines 200..209

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

                                        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