Microsoft/fast-dna

View on GitHub

Showing 3,394 of 3,395 total issues

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

    test("computeAlphaBlend", () => {
        function testColor(data: any): void {
            const bottom: ColorRGBA64 | null = ColorRGBA64.fromObject(data.bottom);
            const top: ColorRGBA64 | null = ColorRGBA64.fromObject(data.top);
            expect(bottom).not.to.be.undefined;
Severity: Major
Found in packages/utilities/fast-colors/src/color-blending.spec.ts and 7 other locations - About 1 day to fix
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 95..111
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 113..129
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 131..147
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 149..165
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 167..183
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 185..201
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 203..219

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

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

    test("blendDodge", () => {
        function testColor(data: any): void {
            const bottom: ColorRGBA64 | null = ColorRGBA64.fromObject(data.bottom);
            const top: ColorRGBA64 | null = ColorRGBA64.fromObject(data.top);
            expect(bottom).not.to.be.undefined;
Severity: Major
Found in packages/utilities/fast-colors/src/color-blending.spec.ts and 7 other locations - About 1 day to fix
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 95..111
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 113..129
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 149..165
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 167..183
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 185..201
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 203..219
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 221..237

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

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

    test("blendScreen", () => {
        function testColor(data: any): void {
            const bottom: ColorRGBA64 | null = ColorRGBA64.fromObject(data.bottom);
            const top: ColorRGBA64 | null = ColorRGBA64.fromObject(data.top);
            expect(bottom).not.to.be.undefined;
Severity: Major
Found in packages/utilities/fast-colors/src/color-blending.spec.ts and 7 other locations - About 1 day to fix
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 95..111
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 113..129
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 131..147
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 149..165
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 167..183
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 185..201
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 221..237

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

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

    test("blendLighten", () => {
        function testColor(data: any): void {
            const bottom: ColorRGBA64 | null = ColorRGBA64.fromObject(data.bottom);
            const top: ColorRGBA64 | null = ColorRGBA64.fromObject(data.top);
            expect(bottom).not.to.be.undefined;
Severity: Major
Found in packages/utilities/fast-colors/src/color-blending.spec.ts and 7 other locations - About 1 day to fix
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 95..111
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 113..129
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 131..147
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 167..183
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 185..201
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 203..219
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 221..237

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

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

    test("blendOverlay", () => {
        function testColor(data: any): void {
            const bottom: ColorRGBA64 | null = ColorRGBA64.fromObject(data.bottom);
            const top: ColorRGBA64 | null = ColorRGBA64.fromObject(data.top);
            expect(bottom).not.to.be.undefined;
Severity: Major
Found in packages/utilities/fast-colors/src/color-blending.spec.ts and 7 other locations - About 1 day to fix
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 95..111
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 113..129
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 131..147
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 149..165
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 167..183
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 203..219
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 221..237

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

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

        it("notifies on changes in a computed if expression", async () => {
            const binding = (x: Model) => x.ifConditional;

            let wasNotified = false;
            const observer = Observable.binding(binding, {
packages/web-components/fast-element/src/observation/observable.spec.ts on lines 311..344

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

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

    test("blendDarken", () => {
        function testColor(data: any): void {
            const bottom: ColorRGBA64 | null = ColorRGBA64.fromObject(data.bottom);
            const top: ColorRGBA64 | null = ColorRGBA64.fromObject(data.top);
            expect(bottom).not.to.be.undefined;
Severity: Major
Found in packages/utilities/fast-colors/src/color-blending.spec.ts and 7 other locations - About 1 day to fix
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 95..111
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 131..147
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 149..165
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 167..183
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 185..201
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 203..219
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 221..237

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

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

    test("blendMultiply", () => {
        function testColor(data: any): void {
            const bottom: ColorRGBA64 | null = ColorRGBA64.fromObject(data.bottom);
            const top: ColorRGBA64 | null = ColorRGBA64.fromObject(data.top);
            expect(bottom).not.to.be.undefined;
Severity: Major
Found in packages/utilities/fast-colors/src/color-blending.spec.ts and 7 other locations - About 1 day to fix
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 95..111
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 113..129
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 131..147
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 149..165
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 185..201
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 203..219
packages/utilities/fast-colors/src/color-blending.spec.ts on lines 221..237

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

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

        it("notifies on changes in a computed ternary expression", async () => {
            const binding = (x: Model) => x.ternaryConditional;

            let wasNotified = false;
            const observer = Observable.binding(binding, {
packages/web-components/fast-element/src/observation/observable.spec.ts on lines 387..420

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

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

File di.spec.ts has 736 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
    Container,
    ContainerImpl,
    DI,
    FactoryImpl,
Severity: Major
Found in packages/web-components/fast-element/src/di/di.spec.ts - About 1 day to fix

    File repeat.spec.ts has 703 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { observable } from "../observation/observable.js";
    import { RepeatBehavior, RepeatDirective, repeat } from "./repeat.js";
    import { expect } from "chai";
    import { html } from "./template.js";
    import { toHTML } from "../__test__/helpers.js";
    Severity: Major
    Found in packages/web-components/fast-element/src/templating/repeat.spec.ts - About 1 day to fix

      File data-grid.ts has 697 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import type { SyntheticViewTemplate, ViewTemplate } from "@microsoft/fast-element";
      import {
          attr,
          FASTElement,
          nullableNumberConverter,
      Severity: Major
      Found in packages/web-components/fast-foundation/src/data-grid/data-grid.ts - About 1 day to fix

        File recognizer.ts has 676 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { Route } from "./navigation.js";
        import { QueryString } from "./query-string.js";
        
        /**
         * @beta
        Severity: Major
        Found in packages/web-components/fast-router/src/recognizer.ts - About 1 day to fix

          File binding.spec.ts has 669 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { expect } from "chai";
          import { HTMLBindingDirective } from "./html-binding-directive.js";
          import { observable } from "../observation/observable.js";
          import { html, ViewTemplate } from "./template.js";
          import { createTrackableDOMPolicy, toHTML } from "../__test__/helpers.js";
          Severity: Major
          Found in packages/web-components/fast-element/src/templating/binding.spec.ts - About 1 day to fix

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

                test("lightenViaLAB", () => {
                    function testColor(data: any): void {
                        const rgb: ColorRGBA64 | null = ColorRGBA64.fromObject(data.rgba);
                        expect(rgb).not.to.be.undefined;
            
            
            Severity: Major
            Found in packages/utilities/fast-colors/src/color-blending.spec.ts and 3 other locations - About 1 day to fix
            packages/utilities/fast-colors/src/color-blending.spec.ts on lines 23..39
            packages/utilities/fast-colors/src/color-blending.spec.ts on lines 41..57
            packages/utilities/fast-colors/src/color-blending.spec.ts on lines 59..75

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

            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

                test("darkenViaLAB", () => {
                    function testColor(data: any): void {
                        const rgb: ColorRGBA64 | null = ColorRGBA64.fromObject(data.rgba);
                        expect(rgb).not.to.be.undefined;
            
            
            Severity: Major
            Found in packages/utilities/fast-colors/src/color-blending.spec.ts and 3 other locations - About 1 day to fix
            packages/utilities/fast-colors/src/color-blending.spec.ts on lines 23..39
            packages/utilities/fast-colors/src/color-blending.spec.ts on lines 41..57
            packages/utilities/fast-colors/src/color-blending.spec.ts on lines 77..93

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

            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

                test("desaturateViaLCH", () => {
                    function testColor(data: any): void {
                        const rgb: ColorRGBA64 | null = ColorRGBA64.fromObject(data.rgba);
                        expect(rgb).not.to.be.undefined;
            
            
            Severity: Major
            Found in packages/utilities/fast-colors/src/color-blending.spec.ts and 3 other locations - About 1 day to fix
            packages/utilities/fast-colors/src/color-blending.spec.ts on lines 23..39
            packages/utilities/fast-colors/src/color-blending.spec.ts on lines 59..75
            packages/utilities/fast-colors/src/color-blending.spec.ts on lines 77..93

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

            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

                test("saturateViaLCH", () => {
                    function testColor(data: any): void {
                        const rgb: ColorRGBA64 | null = ColorRGBA64.fromObject(data.rgba);
                        expect(rgb).not.to.be.undefined;
            
            
            Severity: Major
            Found in packages/utilities/fast-colors/src/color-blending.spec.ts and 3 other locations - About 1 day to fix
            packages/utilities/fast-colors/src/color-blending.spec.ts on lines 41..57
            packages/utilities/fast-colors/src/color-blending.spec.ts on lines 59..75
            packages/utilities/fast-colors/src/color-blending.spec.ts on lines 77..93

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

            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

            File render.spec.ts has 662 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { expect } from "chai";
            import { customElement, FASTElement } from "../components/fast-element.js";
            import { observable } from "../observation/observable.js";
            import { Updates } from "../observation/update-queue.js";
            import { Fake } from "../testing/fakes.js";
            Severity: Major
            Found in packages/web-components/fast-element/src/templating/render.spec.ts - About 1 day to fix

              Function parseStringToOpCodes has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
              Open

              export function parseStringToOpCodes(
                  /**
                   * The string to parse
                   */
                  templateString: string,

              Cognitive Complexity

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

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

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

              Further reading

              Severity
              Category
              Status
              Source
              Language