MichaReiser/speedy.js

View on GitHub
packages/compiler/__integrationtests__/array.spec.ts

Summary

Maintainability
D
2 days
Test Coverage

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

class Point {
    x: number;
    y: number;
    constructor(x: number, y: number) {
        this.x = x;
Severity: Minor
Found in packages/compiler/__integrationtests__/array.spec.ts - About 3 hrs to fix

    Function arraySpliceInsertingNewElements has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    async function arraySpliceInsertingNewElements(array: int[], start: int, deleteCount: int, a: int, b: int, c: int, d: int) {
    Severity: Major
    Found in packages/compiler/__integrationtests__/array.spec.ts - About 50 mins to fix

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

          describe("sort", () => {
              it("sorts the boolean array ascending", async (cb) => {
                  expect(await boolArraySort([true, false, true, true, false])).toEqual([false, false, true, true, true]);
                  cb();
              });
      Severity: Major
      Found in packages/compiler/__integrationtests__/array.spec.ts and 1 other location - About 6 hrs to fix
      packages/compiler/__integrationtests__/array.spec.ts on lines 291..306

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

      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

          describe("wasm2js conversion", () => {
              it("converts the JS boolean array to a WASM boolean array and vice versa", async (cb) => {
                  expect(await boolArrayJS2Wasm([true, false, true, true, false])).toEqual([true, false, true, true, false]);
                  cb();
              });
      Severity: Major
      Found in packages/compiler/__integrationtests__/array.spec.ts and 1 other location - About 6 hrs to fix
      packages/compiler/__integrationtests__/array.spec.ts on lines 369..384

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

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

          describe("shift", () => {
              it("removes and returns the first element", async (cb) => {
                  expect(await arrayShift()).toBe(3);
                  cb();
              });
      Severity: Major
      Found in packages/compiler/__integrationtests__/array.spec.ts and 4 other locations - About 55 mins to fix
      packages/compiler/__integrationtests__/function-declaration.spec.ts on lines 36..41
      packages/compiler/__integrationtests__/function-declaration.spec.ts on lines 43..48
      packages/compiler/__integrationtests__/labeled-statement.spec.ts on lines 21..26
      packages/compiler/__integrationtests__/variable-declaration.spec.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 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

          return [
              new Point(x, x),
              new Point(2.0 * x, 2.0 * x),
              new Point(3.0 * x, 3.0 * x),
              new Point(4.0 * x, 4.0 * x)
      Severity: Minor
      Found in packages/compiler/__integrationtests__/array.spec.ts and 1 other location - About 45 mins to fix
      packages/compiler/__integrationtests__/array.spec.ts on lines 79..84

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

      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

          const array = [
              new Point(x, x),
              new Point(2.0 * x, 2.0 * x),
              new Point(3.0 * x, 3.0 * x),
              new Point(4.0 * x, 4.0 * x)
      Severity: Minor
      Found in packages/compiler/__integrationtests__/array.spec.ts and 1 other location - About 45 mins to fix
      packages/compiler/__integrationtests__/array.spec.ts on lines 44..49

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

      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