leonitousconforti/tinyburg

View on GitHub

Showing 824 of 824 total issues

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

    public onExit(
        state: State,
        callback: (to: State, data: EventData) => boolean
    ): FiniteStateMachine<State, EventData> {
        if (!this._exitCallbacks[state]) {
Severity: Major
Found in packages/bitprints/src/fsm.ts and 1 other location - About 4 hrs to fix
packages/bitprints/src/fsm.ts on lines 90..99

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public onEnter(
        state: State,
        callback: (from: State, data: EventData) => boolean
    ): FiniteStateMachine<State, EventData> {
        if (!this._enterCallbacks[state]) {
Severity: Major
Found in packages/bitprints/src/fsm.ts and 1 other location - About 4 hrs to fix
packages/bitprints/src/fsm.ts on lines 106..115

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

/******/     (() => {
/******/         // getDefaultExport function for compatibility with non-harmony modules
/******/         __webpack_require__.n = (module) => {
/******/             var getter = module && module.__esModule ?
/******/                 () => (module['default']) :
Severity: Major
Found in common/scripts/install-run.js and 1 other location - About 3 hrs to fix
common/scripts/install-run-rush.js on lines 67..76

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

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

/******/     (() => {
/******/         // getDefaultExport function for compatibility with non-harmony modules
/******/         __webpack_require__.n = (module) => {
/******/             var getter = module && module.__esModule ?
/******/                 () => (module['default']) :
Severity: Major
Found in common/scripts/install-run-rush.js and 1 other location - About 3 hrs to fix
common/scripts/install-run.js on lines 235..244

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

Function loadFromVersion has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const loadFromVersion = async (version: string, force = false, log: ILogger = debug): Promise<IStructs> => {
    log.debug("Attempting to load structs for version: %s", version);

    // Filter the folders in this directory for ones that match the version
    const folders = await fs.readdir(new URL(".", import.meta.url), { withFileTypes: true });
Severity: Major
Found in packages/nucleus/src/parsing-structs/load-from-version.ts - About 3 hrs to fix

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

        const handleMouseDown = (event: React.MouseEvent): void => {
            const { offsetX, offsetY } = event.nativeEvent;
            const mouse = {
                x: offsetX,
                y: offsetY,
    Severity: Major
    Found in packages/window/src/components/InteractiveLayer.tsx and 1 other location - About 3 hrs to fix
    packages/window/src/components/InteractiveLayer.tsx on lines 84..94

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        const handleMouseUp = (event: React.MouseEvent): void => {
            const { offsetX, offsetY } = event.nativeEvent;
            const mouse = {
                x: offsetX,
                y: offsetY,
    Severity: Major
    Found in packages/window/src/components/InteractiveLayer.tsx and 1 other location - About 3 hrs to fix
    packages/window/src/components/InteractiveLayer.tsx on lines 72..82

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            const elevators = copyArrayToJs(this.dependencies.elevatorsArray)
                // Copy the elevators array over to js
                .map((elevator) => copyDictionaryToJs<Il2Cpp.String, Il2Cpp.Object>(elevator))
    
                // Read all the properties of every elevator entry
    Severity: Major
    Found in packages/insight/src/agents/get-elevator-data.ts and 1 other location - About 3 hrs to fix
    packages/insight/src/agents/get-roof-data.ts on lines 29..37

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

                copyArrayToJs(this.dependencies.roofsArray)
                    // Then each entry in the JS array is a dictionary, so map to that dictionary
                    .map((roof) => copyDictionaryToJs<Il2Cpp.String, Il2Cpp.Object>(roof))
    
                    // Next, map the entries of the roof dictionary to the property name and extract its JS value
    Severity: Major
    Found in packages/insight/src/agents/get-roof-data.ts and 1 other location - About 3 hrs to fix
    packages/insight/src/agents/get-elevator-data.ts on lines 27..35

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            const hairColors = copyListToJs<Il2Cpp.Array<Il2Cpp.Object>>(this.dependencies.hairColorsList)
                .map((il2CppArray) => copyArrayToJs(il2CppArray))
                .map((jsIl2cppObjectArray) => jsIl2cppObjectArray.map(Number))
                .map((jsNumberArray) => colorToObject(jsNumberArray as [number, number, number]));
    Severity: Major
    Found in packages/insight/src/agents/get-bitizen-data.ts and 1 other location - About 3 hrs to fix
    packages/insight/src/agents/get-bitizen-data.ts on lines 59..62

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 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

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

            const skinColors = copyListToJs<Il2Cpp.Array<Il2Cpp.Object>>(this.dependencies.skinColorsList)
                .map((il2cppArray) => copyArrayToJs(il2cppArray))
                .map((jsIl2cppObjectArray) => jsIl2cppObjectArray.map(Number))
                .map((jsNumberArray) => colorToObject(jsNumberArray as [number, number, number]));
    Severity: Major
    Found in packages/insight/src/agents/get-bitizen-data.ts and 1 other location - About 3 hrs to fix
    packages/insight/src/agents/get-bitizen-data.ts on lines 67..70

    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

    Function WithMouseKeyHandler has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    export const WithMouseKeyHandler: React.FunctionComponent<IWithMouseKeyHandlerProps> = ({
        jsep,
        emulatorClient,
        children,
    }) => {
    Severity: Minor
    Found in packages/window/src/components/InteractiveLayer.tsx - 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 concatenationSubRoutine has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    export const concatenationSubRoutine = function <T extends GenericBlocks, U extends GenericJsonSave<T>>(
        jsonSave: U,
        blocksToUse: T,
        log: ILogger = debug
    ): DecompressedSave {
    Severity: Minor
    Found in packages/nucleus/src/parsing-structs/parsing-subroutines.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 matchTemplate has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const matchTemplate = (
        searchImage: Image,
        templateImage: Image,
        mask?: Image,
        wantExact: boolean = true,
    Severity: Major
    Found in packages/doorman/src/image-operations/template-matching.ts - About 2 hrs to fix

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

              animations: [
                  { element: "nasascreen", x: 3, y: 30, ftime: "0.3" },
                  { element: "nasanum", x: 68, y: 6, ftime: "1" },
                  { element: "nasamap", x: 77, y: 30, ftime: "0.1" },
                  { element: "nasacomp", x: 61, y: 40, ftime: "0.1" },
      Severity: Major
      Found in packages/nucleus/src/data/floors.ts and 3 other locations - About 2 hrs to fix
      packages/nucleus/src/data/floors.ts on lines 811..816
      packages/nucleus/src/data/roofs.ts on lines 155..160
      packages/nucleus/src/data/roofs.ts on lines 428..433

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

              animations: [
                  { element: "heart", x: 35, y: 100, ftime: "0.25" },
                  { element: "heart", x: 20, y: 90, ftime: "0.15" },
                  { element: "heart", x: 135, y: 85, ftime: "0.25" },
                  { element: "heart", x: 120, y: 80, ftime: "0.15" },
      Severity: Major
      Found in packages/nucleus/src/data/roofs.ts and 3 other locations - About 2 hrs to fix
      packages/nucleus/src/data/floors.ts on lines 284..289
      packages/nucleus/src/data/floors.ts on lines 811..816
      packages/nucleus/src/data/roofs.ts on lines 155..160

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

              animations: [
                  { element: "shuttlea", x: 30, y: 162, ftime: "1.25" },
                  { element: "shuttleb", x: 131, y: 165, ftime: "1.25" },
                  { element: "shuttlec", x: 15, y: 344, ftime: "1.25" },
                  { element: "shuttled", x: 138, y: 346, ftime: "1.25" },
      Severity: Major
      Found in packages/nucleus/src/data/roofs.ts and 3 other locations - About 2 hrs to fix
      packages/nucleus/src/data/floors.ts on lines 284..289
      packages/nucleus/src/data/floors.ts on lines 811..816
      packages/nucleus/src/data/roofs.ts on lines 428..433

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

              animations: [
                  { element: "floor312_light", x: 79, y: 30, ftime: "0.2" },
                  { element: "floor312_cogs", x: 93, y: 41, ftime: "0.125" },
                  { element: "floor312_stick", x: 81, y: 27, ftime: "0.25" },
                  { element: "floor312_eggs", x: 92, y: 34, ftime: "0.125" },
      Severity: Major
      Found in packages/nucleus/src/data/floors.ts and 3 other locations - About 2 hrs to fix
      packages/nucleus/src/data/floors.ts on lines 284..289
      packages/nucleus/src/data/roofs.ts on lines 155..160
      packages/nucleus/src/data/roofs.ts on lines 428..433

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

      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

      Function sort has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public sort(compare: (a: NodeData, b: NodeData) => boolean): DoublyLinkedList<NodeData> {
              if (this._head === undefined || this._tail === undefined) {
                  return this;
              }
              if (this.length < 2) {
      Severity: Minor
      Found in packages/bitprints/src/doubly-linked-list.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

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

          retrieveData() {
              const memoryRange = { base: this.dependencies.musicEnabledField.handle, size: 1 };
              const callbacks = {
                  onAccess: () => this.emittery.emit("musicStatusChanged", this.dependencies.musicEnabledField.value),
              };
      Severity: Major
      Found in packages/insight/examples/js/alert-agent2.js and 1 other location - About 2 hrs to fix
      packages/insight/examples/js-typed/alert-agent2.js on lines 35..41

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Severity
      Category
      Status
      Source
      Language