enclose-io/compiler

View on GitHub
lts/deps/v8/tools/turbolizer/src/source-resolver.ts

Summary

Maintainability
F
1 mo
Test Coverage

File source-resolver.ts has 641 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright 2018 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.

import { sortUnique, anyToString } from "../src/util";
Severity: Major
Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 1 day to fix

    SourceResolver has 43 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class SourceResolver {
      nodePositionMap: Array<AnyPosition>;
      sources: Array<Source>;
      inlinings: Array<Inlining>;
      inliningsMap: Map<string, Inlining>;
    Severity: Minor
    Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 5 hrs to fix

      Function parsePhases has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

        parsePhases(phases) {
          const nodeLabelMap = [];
          for (const [, phase] of Object.entries<Phase>(phases)) {
            switch (phase.type) {
              case 'disassembly':
      Severity: Minor
      Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - 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 nodesForPCOffset has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

        nodesForPCOffset(offset: number): [Array<string>, Array<string>] {
          if (this.pcOffsets.length === 0) return [[], []];
          for (const key of this.pcOffsets) {
            if (key <= offset) {
              const instrs = this.pcOffsetToInstructions.get(key);
      Severity: Minor
      Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - 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 getInstructionKindForPCOffset has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

        getInstructionKindForPCOffset(offset: number) {
          if (this.codeOffsetsInfo) {
            if (offset >= this.codeOffsetsInfo.deoptimizationExits) {
              if (offset >= this.codeOffsetsInfo.pools) {
                return "pools";
      Severity: Minor
      Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - 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 parseSchedule has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        parseSchedule(phase) {
          function createNode(state: any, match) {
            let inputs = [];
            if (match.groups.args) {
              const nodeIdsString = match.groups.args.replace(/\s/g, '');
      Severity: Major
      Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 3 hrs to fix

        Function parseSchedule has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

          parseSchedule(phase) {
            function createNode(state: any, match) {
              let inputs = [];
              if (match.groups.args) {
                const nodeIdsString = match.groups.args.replace(/\s/g, '');
        Severity: Minor
        Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - 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 parsePhases has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          parsePhases(phases) {
            const nodeLabelMap = [];
            for (const [, phase] of Object.entries<Phase>(phases)) {
              switch (phase.type) {
                case 'disassembly':
        Severity: Minor
        Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 1 hr to fix

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

            setNodePositionMap(map) {
              if (!map) return;
              if (typeof map[0] != 'object') {
                const alternativeMap = {};
                for (const [nodeId, scriptOffset] of Object.entries<number>(map)) {
          Severity: Minor
          Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - 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 recordOrigins has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            recordOrigins(phase: GraphPhase) {
              if (phase.type != "graph") return;
              for (const node of phase.data.nodes) {
                phase.highestNodeId = Math.max(phase.highestNodeId, node.id);
                if (node.origin != undefined &&
          Severity: Minor
          Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - 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 getInstructionKindForPCOffset has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            getInstructionKindForPCOffset(offset: number) {
              if (this.codeOffsetsInfo) {
                if (offset >= this.codeOffsetsInfo.deoptimizationExits) {
                  if (offset >= this.codeOffsetsInfo.pools) {
                    return "pools";
          Severity: Minor
          Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 1 hr to fix

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

              setNodePositionMap(map) {
                if (!map) return;
                if (typeof map[0] != 'object') {
                  const alternativeMap = {};
                  for (const [nodeId, scriptOffset] of Object.entries<number>(map)) {
            Severity: Minor
            Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 1 hr to fix

              Avoid deeply nested control flow statements.
              Open

                          if (start == end && instr == start) {
                            nodes.push("" + nodeId);
                          }
              Severity: Major
              Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                              if (!this.blockStartPCtoBlockIds.has(pc)) {
                                this.blockStartPCtoBlockIds.set(pc, []);
                              }
                Severity: Major
                Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              if (!range) continue;
                  Severity: Major
                  Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                if (start <= instr && instr < end) {
                                  nodes.push("" + nodeId);
                                }
                    Severity: Major
                    Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 45 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              if (!info || info.gap == info.condition) return "unknown";
                      Severity: Major
                      Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return "unknown";
                        Severity: Major
                        Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  if (offset < info.arch) return "gap";
                          Severity: Major
                          Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    if (offset < info.condition) return "arch";
                            Severity: Major
                            Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return "deopt-check";
                              Severity: Major
                              Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return "init-poison";
                                Severity: Major
                                Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return "condition";
                                  Severity: Major
                                  Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - About 30 mins to fix

                                    Function readInstructionOffsetToPCOffset has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      readInstructionOffsetToPCOffset(instructionToPCOffset) {
                                        for (const [instruction, numberOrInfo] of Object.entries<number | TurbolizerInstructionStartInfo>(instructionToPCOffset)) {
                                          let info: TurbolizerInstructionStartInfo;
                                          if (typeof numberOrInfo == "number") {
                                            info = { gap: numberOrInfo, arch: numberOrInfo, condition: numberOrInfo };
                                    Severity: Minor
                                    Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - 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

                                    Function internNodeLabels has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      internNodeLabels(phase: GraphPhase, nodeLabelMap: Array<NodeLabel>) {
                                        for (const n of phase.data.nodes) {
                                          const label = new NodeLabel(n.id, n.label, n.title, n.live,
                                            n.properties, n.sourcePosition, n.origin, n.opcode, n.control,
                                            n.opinfo, n.type);
                                    Severity: Minor
                                    Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts - 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

                                    export class SourceResolver {
                                      nodePositionMap: Array<AnyPosition>;
                                      sources: Array<Source>;
                                      inlinings: Array<Inlining>;
                                      inliningsMap: Map<string, Inlining>;
                                    Severity: Major
                                    Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts and 1 other location - About 1 mo to fix
                                    current/deps/v8/tools/turbolizer/src/source-resolver.ts on lines 123..727

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

                                    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

                                    export function sourcePositionToStringKey(sourcePosition: AnyPosition): string {
                                      if (!sourcePosition) return "undefined";
                                      if ('inliningId' in sourcePosition && 'scriptOffset' in sourcePosition) {
                                        return "SP:" + sourcePosition.inliningId + ":" + sourcePosition.scriptOffset;
                                      }
                                    Severity: Major
                                    Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts and 1 other location - About 3 hrs to fix
                                    current/deps/v8/tools/turbolizer/src/source-resolver.ts on lines 20..29

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

                                    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

                                    export interface Source {
                                      sourcePositions: Array<SourcePosition>;
                                      sourceName: string;
                                      functionName: string;
                                      sourceText: string;
                                    Severity: Major
                                    Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts and 1 other location - About 1 hr to fix
                                    current/deps/v8/tools/turbolizer/src/source-resolver.ts on lines 60..68

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

                                    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 CodeOffsetsInfo {
                                      codeStartRegisterCheck: number;
                                      deoptCheck: number;
                                      initPoison: number;
                                      blocksStart: number;
                                    Severity: Major
                                    Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts and 1 other location - About 1 hr to fix
                                    current/deps/v8/tools/turbolizer/src/source-resolver.ts on lines 107..116

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 62.

                                    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

                                    interface InstructionsPhase {
                                      type: "instructions";
                                      name: string;
                                      data: any;
                                      instructionOffsetToPCOffset?: any;
                                    Severity: Major
                                    Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts and 1 other location - About 1 hr to fix
                                    current/deps/v8/tools/turbolizer/src/source-resolver.ts on lines 79..87

                                    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

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

                                    function sourcePositionLe(a, b) {
                                      if (a.inliningId == b.inliningId) {
                                        return a.scriptOffset - b.scriptOffset;
                                      }
                                      return a.inliningId - b.inliningId;
                                    Severity: Major
                                    Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts and 1 other location - About 1 hr to fix
                                    current/deps/v8/tools/turbolizer/src/source-resolver.ts on lines 8..13

                                    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

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

                                    export function sourcePositionValid(l) {
                                      return (typeof l.scriptOffset !== undefined
                                        && typeof l.inliningId !== undefined) || typeof l.bytecodePosition != undefined;
                                    }
                                    Severity: Minor
                                    Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts and 1 other location - About 55 mins to fix
                                    current/deps/v8/tools/turbolizer/src/source-resolver.ts on lines 31..34

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

                                    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

                                    interface GraphPhase {
                                      type: "graph";
                                      name: string;
                                      data: any;
                                      highestNodeId: number;
                                    Severity: Minor
                                    Found in lts/deps/v8/tools/turbolizer/src/source-resolver.ts and 1 other location - About 50 mins to fix
                                    current/deps/v8/tools/turbolizer/src/source-resolver.ts on lines 89..95

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

                                    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