aurelia/aurelia

View on GitHub
packages/__tests__/src/router-lite/ast.spec.ts

Summary

Maintainability
F
3 days
Test Coverage

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

import { assert } from '@aurelia/testing';
import {
  RouteExpression,
  CompositeSegmentExpression,
  ScopedSegmentExpression,
Severity: Minor
Found in packages/__tests__/src/router-lite/ast.spec.ts - About 7 hrs to fix

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

      for (const path of ['/a(1=', ...terminal.map(t => `/a(1=${t}`)]) {
        it(`throws on empty parameter value '${path}'`, function () {
          assert.throws(
            function () {
              RouteExpression.parse(pathUrlParser.parse(path));
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 3 other locations - About 3 hrs to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 400..409
    packages/__tests__/src/router-lite/ast.spec.ts on lines 411..420
    packages/__tests__/src/router-lite/ast.spec.ts on lines 422..431

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

    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

      for (const path of ['/a@', ...terminal.map(t => `/a@${t}`)]) {
        it(`throws on empty viewport name '${path}'`, function () {
          assert.throws(
            function () {
              RouteExpression.parse(pathUrlParser.parse(path));
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 3 other locations - About 3 hrs to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 400..409
    packages/__tests__/src/router-lite/ast.spec.ts on lines 422..431
    packages/__tests__/src/router-lite/ast.spec.ts on lines 433..442

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

    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

      for (const path of ['/a(', ...terminal.map(t => `/a(${t}`)]) {
        it(`throws on empty parameter key '${path}'`, function () {
          assert.throws(
            function () {
              RouteExpression.parse(pathUrlParser.parse(path));
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 3 other locations - About 3 hrs to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 400..409
    packages/__tests__/src/router-lite/ast.spec.ts on lines 411..420
    packages/__tests__/src/router-lite/ast.spec.ts on lines 433..442

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

    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

      for (const path of ['/', ...terminal.map(t => `/${t}`)]) {
        it(`throws on empty component name '${path}'`, function () {
          assert.throws(
            function () {
              RouteExpression.parse(pathUrlParser.parse(path));
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 3 other locations - About 3 hrs to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 411..420
    packages/__tests__/src/router-lite/ast.spec.ts on lines 422..431
    packages/__tests__/src/router-lite/ast.spec.ts on lines 433..442

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

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

            specs[`/${raw}?foo=bar&fiz=baz`] = [new RouteExpression(
              true,
              new SegmentExpression(component, viewport, scoped),
              Object.freeze(new URLSearchParams('foo=bar&fiz=baz')),
              null,
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 2 other locations - About 1 hr to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 115..120
    packages/__tests__/src/router-lite/ast.spec.ts on lines 129..134

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

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

            specs[`/${raw}?foo=bar`] = [new RouteExpression(
              true,
              new SegmentExpression(component, viewport, scoped),
              Object.freeze(new URLSearchParams('foo=bar')),
              null,
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 2 other locations - About 1 hr to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 122..127
    packages/__tests__/src/router-lite/ast.spec.ts on lines 129..134

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

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

            specs[`/${raw}?foo=bar1&fiz=baz&foo=bar2`] = [new RouteExpression(
              true,
              new SegmentExpression(component, viewport, scoped),
              Object.freeze(new URLSearchParams('foo=bar1&fiz=baz&foo=bar2')),
              null,
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 2 other locations - About 1 hr to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 115..120
    packages/__tests__/src/router-lite/ast.spec.ts on lines 122..127

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

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

      x['a+b+c']   = [new CompositeSegmentExpression([x['a'][0], x['b'][0], x['c'][0],]), 'a+b+c'];
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 11 other locations - About 35 mins to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 223..223
    packages/__tests__/src/router-lite/ast.spec.ts on lines 231..231
    packages/__tests__/src/router-lite/ast.spec.ts on lines 286..286
    packages/__tests__/src/router-lite/ast.spec.ts on lines 287..287
    packages/__tests__/src/router-lite/ast.spec.ts on lines 288..288
    packages/__tests__/src/router-lite/ast.spec.ts on lines 297..297
    packages/__tests__/src/router-lite/ast.spec.ts on lines 298..298
    packages/__tests__/src/router-lite/ast.spec.ts on lines 306..306
    packages/__tests__/src/router-lite/ast.spec.ts on lines 308..308
    packages/__tests__/src/router-lite/ast.spec.ts on lines 317..317
    packages/__tests__/src/router-lite/ast.spec.ts on lines 320..320

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 46.

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

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

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

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

    Refactorings

    Further Reading

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

      x['(a/b)+c+d']   = [new CompositeSegmentExpression([x['(a/b)'][0], x['c'][0], x['d'][0],]), '(a/b)+c+d'];
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 11 other locations - About 35 mins to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 215..215
    packages/__tests__/src/router-lite/ast.spec.ts on lines 223..223
    packages/__tests__/src/router-lite/ast.spec.ts on lines 231..231
    packages/__tests__/src/router-lite/ast.spec.ts on lines 286..286
    packages/__tests__/src/router-lite/ast.spec.ts on lines 287..287
    packages/__tests__/src/router-lite/ast.spec.ts on lines 288..288
    packages/__tests__/src/router-lite/ast.spec.ts on lines 297..297
    packages/__tests__/src/router-lite/ast.spec.ts on lines 306..306
    packages/__tests__/src/router-lite/ast.spec.ts on lines 308..308
    packages/__tests__/src/router-lite/ast.spec.ts on lines 317..317
    packages/__tests__/src/router-lite/ast.spec.ts on lines 320..320

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 46.

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

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

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

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

    Refactorings

    Further Reading

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

      x['a+(b/c)+d']   = [new CompositeSegmentExpression([x['a'][0], x['(b/c)'][0], x['d'][0],]), 'a+(b/c)+d'];
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 11 other locations - About 35 mins to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 215..215
    packages/__tests__/src/router-lite/ast.spec.ts on lines 223..223
    packages/__tests__/src/router-lite/ast.spec.ts on lines 231..231
    packages/__tests__/src/router-lite/ast.spec.ts on lines 286..286
    packages/__tests__/src/router-lite/ast.spec.ts on lines 287..287
    packages/__tests__/src/router-lite/ast.spec.ts on lines 288..288
    packages/__tests__/src/router-lite/ast.spec.ts on lines 297..297
    packages/__tests__/src/router-lite/ast.spec.ts on lines 298..298
    packages/__tests__/src/router-lite/ast.spec.ts on lines 306..306
    packages/__tests__/src/router-lite/ast.spec.ts on lines 317..317
    packages/__tests__/src/router-lite/ast.spec.ts on lines 320..320

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 46.

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

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

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

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

    Refactorings

    Further Reading

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

      x['+a+b+c']   = [new CompositeSegmentExpression([x['a'][0], x['b'][0], x['c'][0],]), 'a+b+c'];
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 11 other locations - About 35 mins to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 215..215
    packages/__tests__/src/router-lite/ast.spec.ts on lines 231..231
    packages/__tests__/src/router-lite/ast.spec.ts on lines 286..286
    packages/__tests__/src/router-lite/ast.spec.ts on lines 287..287
    packages/__tests__/src/router-lite/ast.spec.ts on lines 288..288
    packages/__tests__/src/router-lite/ast.spec.ts on lines 297..297
    packages/__tests__/src/router-lite/ast.spec.ts on lines 298..298
    packages/__tests__/src/router-lite/ast.spec.ts on lines 306..306
    packages/__tests__/src/router-lite/ast.spec.ts on lines 308..308
    packages/__tests__/src/router-lite/ast.spec.ts on lines 317..317
    packages/__tests__/src/router-lite/ast.spec.ts on lines 320..320

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 46.

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

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

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

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

    Refactorings

    Further Reading

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

      x['a+(b+c)+d']   = [new CompositeSegmentExpression([x['a'][0], x['(b+c)'][0], x['d'][0],]), 'a+(b+c)+d'];
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 11 other locations - About 35 mins to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 215..215
    packages/__tests__/src/router-lite/ast.spec.ts on lines 223..223
    packages/__tests__/src/router-lite/ast.spec.ts on lines 231..231
    packages/__tests__/src/router-lite/ast.spec.ts on lines 286..286
    packages/__tests__/src/router-lite/ast.spec.ts on lines 288..288
    packages/__tests__/src/router-lite/ast.spec.ts on lines 297..297
    packages/__tests__/src/router-lite/ast.spec.ts on lines 298..298
    packages/__tests__/src/router-lite/ast.spec.ts on lines 306..306
    packages/__tests__/src/router-lite/ast.spec.ts on lines 308..308
    packages/__tests__/src/router-lite/ast.spec.ts on lines 317..317
    packages/__tests__/src/router-lite/ast.spec.ts on lines 320..320

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 46.

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

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

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

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

    Refactorings

    Further Reading

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

      x['a+b+c/d']     = [new CompositeSegmentExpression([x['a'][0], x['b'][0], x['c/d'][0],]), 'a+b+c/d'];
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 11 other locations - About 35 mins to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 215..215
    packages/__tests__/src/router-lite/ast.spec.ts on lines 223..223
    packages/__tests__/src/router-lite/ast.spec.ts on lines 231..231
    packages/__tests__/src/router-lite/ast.spec.ts on lines 286..286
    packages/__tests__/src/router-lite/ast.spec.ts on lines 287..287
    packages/__tests__/src/router-lite/ast.spec.ts on lines 288..288
    packages/__tests__/src/router-lite/ast.spec.ts on lines 297..297
    packages/__tests__/src/router-lite/ast.spec.ts on lines 298..298
    packages/__tests__/src/router-lite/ast.spec.ts on lines 306..306
    packages/__tests__/src/router-lite/ast.spec.ts on lines 308..308
    packages/__tests__/src/router-lite/ast.spec.ts on lines 320..320

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 46.

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

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

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

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

    Refactorings

    Further Reading

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

      x['a+b+(c+d)']   = [new CompositeSegmentExpression([x['a'][0], x['b'][0], x['(c+d)'][0],]), 'a+b+(c+d)'];
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 11 other locations - About 35 mins to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 215..215
    packages/__tests__/src/router-lite/ast.spec.ts on lines 223..223
    packages/__tests__/src/router-lite/ast.spec.ts on lines 231..231
    packages/__tests__/src/router-lite/ast.spec.ts on lines 286..286
    packages/__tests__/src/router-lite/ast.spec.ts on lines 287..287
    packages/__tests__/src/router-lite/ast.spec.ts on lines 297..297
    packages/__tests__/src/router-lite/ast.spec.ts on lines 298..298
    packages/__tests__/src/router-lite/ast.spec.ts on lines 306..306
    packages/__tests__/src/router-lite/ast.spec.ts on lines 308..308
    packages/__tests__/src/router-lite/ast.spec.ts on lines 317..317
    packages/__tests__/src/router-lite/ast.spec.ts on lines 320..320

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 46.

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

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

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

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

    Refactorings

    Further Reading

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

      x['b+c+d']   = [new CompositeSegmentExpression([x['b'][0], x['c'][0], x['d'][0],]), 'b+c+d'];
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 11 other locations - About 35 mins to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 215..215
    packages/__tests__/src/router-lite/ast.spec.ts on lines 223..223
    packages/__tests__/src/router-lite/ast.spec.ts on lines 286..286
    packages/__tests__/src/router-lite/ast.spec.ts on lines 287..287
    packages/__tests__/src/router-lite/ast.spec.ts on lines 288..288
    packages/__tests__/src/router-lite/ast.spec.ts on lines 297..297
    packages/__tests__/src/router-lite/ast.spec.ts on lines 298..298
    packages/__tests__/src/router-lite/ast.spec.ts on lines 306..306
    packages/__tests__/src/router-lite/ast.spec.ts on lines 308..308
    packages/__tests__/src/router-lite/ast.spec.ts on lines 317..317
    packages/__tests__/src/router-lite/ast.spec.ts on lines 320..320

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 46.

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

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

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

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

    Refactorings

    Further Reading

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

      x['a/b+c+d']     = [new CompositeSegmentExpression([x['a/b'][0], x['c'][0], x['d'][0],]), 'a/b+c+d'];
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 11 other locations - About 35 mins to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 215..215
    packages/__tests__/src/router-lite/ast.spec.ts on lines 223..223
    packages/__tests__/src/router-lite/ast.spec.ts on lines 231..231
    packages/__tests__/src/router-lite/ast.spec.ts on lines 286..286
    packages/__tests__/src/router-lite/ast.spec.ts on lines 287..287
    packages/__tests__/src/router-lite/ast.spec.ts on lines 288..288
    packages/__tests__/src/router-lite/ast.spec.ts on lines 298..298
    packages/__tests__/src/router-lite/ast.spec.ts on lines 306..306
    packages/__tests__/src/router-lite/ast.spec.ts on lines 308..308
    packages/__tests__/src/router-lite/ast.spec.ts on lines 317..317
    packages/__tests__/src/router-lite/ast.spec.ts on lines 320..320

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 46.

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

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

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

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

    Refactorings

    Further Reading

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

      x['a+b/c+d']     = [new CompositeSegmentExpression([x['a'][0], x['b/c'][0], x['d'][0],]), 'a+b/c+d'];
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 11 other locations - About 35 mins to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 215..215
    packages/__tests__/src/router-lite/ast.spec.ts on lines 223..223
    packages/__tests__/src/router-lite/ast.spec.ts on lines 231..231
    packages/__tests__/src/router-lite/ast.spec.ts on lines 286..286
    packages/__tests__/src/router-lite/ast.spec.ts on lines 287..287
    packages/__tests__/src/router-lite/ast.spec.ts on lines 288..288
    packages/__tests__/src/router-lite/ast.spec.ts on lines 297..297
    packages/__tests__/src/router-lite/ast.spec.ts on lines 298..298
    packages/__tests__/src/router-lite/ast.spec.ts on lines 308..308
    packages/__tests__/src/router-lite/ast.spec.ts on lines 317..317
    packages/__tests__/src/router-lite/ast.spec.ts on lines 320..320

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 46.

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

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

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

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

    Refactorings

    Further Reading

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

      x['a+b+(c/d)']   = [new CompositeSegmentExpression([x['a'][0], x['b'][0], x['(c/d)'][0],]), 'a+b+(c/d)'];
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 11 other locations - About 35 mins to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 215..215
    packages/__tests__/src/router-lite/ast.spec.ts on lines 223..223
    packages/__tests__/src/router-lite/ast.spec.ts on lines 231..231
    packages/__tests__/src/router-lite/ast.spec.ts on lines 286..286
    packages/__tests__/src/router-lite/ast.spec.ts on lines 287..287
    packages/__tests__/src/router-lite/ast.spec.ts on lines 288..288
    packages/__tests__/src/router-lite/ast.spec.ts on lines 297..297
    packages/__tests__/src/router-lite/ast.spec.ts on lines 298..298
    packages/__tests__/src/router-lite/ast.spec.ts on lines 306..306
    packages/__tests__/src/router-lite/ast.spec.ts on lines 308..308
    packages/__tests__/src/router-lite/ast.spec.ts on lines 317..317

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 46.

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

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

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

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

    Refactorings

    Further Reading

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

      x['(a+b)+c+d']   = [new CompositeSegmentExpression([x['(a+b)'][0], x['c'][0], x['d'][0],]), '(a+b)+c+d'];
    Severity: Major
    Found in packages/__tests__/src/router-lite/ast.spec.ts and 11 other locations - About 35 mins to fix
    packages/__tests__/src/router-lite/ast.spec.ts on lines 215..215
    packages/__tests__/src/router-lite/ast.spec.ts on lines 223..223
    packages/__tests__/src/router-lite/ast.spec.ts on lines 231..231
    packages/__tests__/src/router-lite/ast.spec.ts on lines 287..287
    packages/__tests__/src/router-lite/ast.spec.ts on lines 288..288
    packages/__tests__/src/router-lite/ast.spec.ts on lines 297..297
    packages/__tests__/src/router-lite/ast.spec.ts on lines 298..298
    packages/__tests__/src/router-lite/ast.spec.ts on lines 306..306
    packages/__tests__/src/router-lite/ast.spec.ts on lines 308..308
    packages/__tests__/src/router-lite/ast.spec.ts on lines 317..317
    packages/__tests__/src/router-lite/ast.spec.ts on lines 320..320

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 46.

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status