Opetushallitus/eperusteet-frontend-utils

View on GitHub

Showing 186 of 186 total issues

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

const tyypitettyKohdereititysId = {
  'ops': { ...kohdereititysId },
  'normaali': { ...kohdereititysId, ...perusteKohdereititysId },
  'pohja': { ...kohdereititysId, ...perusteKohdereititysId },
  'opas': { ...kohdereititysId, ...perusteKohdereititysId },
Severity: Minor
Found in vue/src/utils/tapahtuma.ts and 1 other location - About 55 mins to fix
vue/src/utils/tapahtuma.ts on lines 33..38

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

Function update has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  public async update() {
    if (this.state.perusteId) {
      if (this.state.muokkaustiedot && !_.isEmpty(this.state.muokkaustiedot)) {
        this.state.viimeinenHaku = (await Muokkaustiedot.getPerusteenMuokkausTiedotWithLuomisaika(this.state.perusteId, (_.last(this.state.muokkaustiedot) as any).luotu, this.state.hakuLukumaara) as any).data;

Severity: Minor
Found in vue/src/stores/MuokkaustietoStore.ts - About 45 mins to fix

Cognitive Complexity

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

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

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

Further reading

Avoid deeply nested control flow statements.
Open

                        if (id && !(id in cache)) {
                            cache[id] = true;
                            stack.push(head[key]);
                        }
Severity: Major
Found in components/history/history.ts - About 45 mins to fix

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

    const ax = axios.create({
      baseURL,
      paramsSerializer: (params: any) => Qs.stringify(params, { arrayFormat: 'repeat' }),
    });
    Severity: Minor
    Found in vue/src/api/eperusteet.ts and 1 other location - About 40 mins to fix
    vue/src/api/amosaa.ts on lines 38..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 49.

    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 ax = axios.create({
      baseURL,
      paramsSerializer: (params: any) => Qs.stringify(params, { arrayFormat: 'repeat' }),
    });
    Severity: Minor
    Found in vue/src/api/amosaa.ts and 1 other location - About 40 mins to fix
    vue/src/api/eperusteet.ts on lines 37..40

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

    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 koulutustyyppiRyhmaTiles = {
      'lukiokoulutus': tileLukio,
      'esiopetus': tileEsiopetus,
      'perusopetus': tilePerusopetus,
      'taiteenperusopetus': tileTaiteenperusopetus,
    Severity: Minor
    Found in vue/src/utils/bannerIcons.ts and 1 other location - About 40 mins to fix
    vue/src/utils/bannerIcons.ts on lines 32..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 48.

    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 koulutustyyppiRyhmaBanners = {
      'lukiokoulutus': bannerLukio,
      'esiopetus': bannerEsiopetus,
      'perusopetus': bannerPerusopetus,
      'taiteenperusopetus': bannerTaiteenperusopetus,
    Severity: Minor
    Found in vue/src/utils/bannerIcons.ts and 1 other location - About 40 mins to fix
    vue/src/utils/bannerIcons.ts on lines 21..30

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

    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 muokkaustietoRoute has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    export function muokkaustietoRoute(id, kohde, tapahtuma, tyyppi = 'ops', lisaparametrit?) {
    Severity: Minor
    Found in vue/src/utils/tapahtuma.ts - About 35 mins to fix

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

        case 'tekstikappale':
          // Route linkki
          node.location = {
            name: 'perusteTekstikappale',
            params: {
      Severity: Minor
      Found in vue/src/utils/NavigationBuilder.ts and 1 other location - About 35 mins to fix
      vue/src/utils/NavigationBuilder.ts on lines 456..464

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

      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

        case 'liite':
          // Route linkki
          node.location = {
            name: 'opetussuunnitelmaTekstikappale',
            params: {
      Severity: Minor
      Found in vue/src/utils/NavigationBuilder.ts and 1 other location - About 35 mins to fix
      vue/src/utils/NavigationBuilder.ts on lines 146..154

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

      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

            mounted() {
              if (!(this as any).node.attrs['data-viite']) {
                (this as any).showTermiSelector();
              }
            },
      Severity: Minor
      Found in vue/src/components/EpContent/TermiExtension.ts and 1 other location - About 35 mins to fix
      vue/src/components/EpContent/ImageExtension.ts on lines 77..81

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

      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

          vue.prototype.$success = function(title: string) {
            this.$notify({
              title,
              type: 'success',
            });
      Severity: Minor
      Found in vue/src/plugins/notifikaatiot.ts and 1 other location - About 35 mins to fix
      vue/src/plugins/notifikaatiot.ts on lines 45..50

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

      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

          vue.prototype.$info = function(title: string) {
            this.$notify({
              title,
              type: 'info',
            });
      Severity: Minor
      Found in vue/src/plugins/notifikaatiot.ts and 1 other location - About 35 mins to fix
      vue/src/plugins/notifikaatiot.ts on lines 38..43

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

      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

            mounted() {
              if (!(this as any).node.attrs['data-uid']) {
                (this as any).open();
              }
            },
      Severity: Minor
      Found in vue/src/components/EpContent/ImageExtension.ts and 1 other location - About 35 mins to fix
      vue/src/components/EpContent/TermiExtension.ts on lines 61..65

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

      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 start has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        public async start() {
          this.state.disabled = true;
          this.state.isLoading = true;
      
          // Ei editointia uudestaan
      Severity: Minor
      Found in vue/src/components/EpEditointi/EditointiStore.ts - About 35 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function save has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        public async save() {
          this.state.disabled = true;
          this.state.isSaving = true;
      
          if (!this.isEditing.value) {
      Severity: Minor
      Found in vue/src/components/EpEditointi/EditointiStore.ts - About 35 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function setUiKieli has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          export const setUiKieli = (kielikoodi, doStateChange?) => {
              if (isValidKielikoodi(kielikoodi) &&
                      (kielikoodi !== uikieli || (stateInited && _$stateParams.lang !== kielikoodi))) {
                  if (_.isUndefined(doStateChange) || doStateChange === true) {
                      _$state.go(_$state.current.name, _.merge(_$stateParams, {lang: kielikoodi}), {reload: true});
      Severity: Minor
      Found in components/lokalisointi/kieli.ts - About 35 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

                  if (!!(this as any).altText && (this as any).altText !== 'undefined') {
                    return (this as any).altText;
                  }
      Severity: Minor
      Found in vue/src/components/EpContent/ImageExtension.ts and 1 other location - About 35 mins to fix
      vue/src/components/EpContent/ImageExtension.ts on lines 177..179

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

                  if (!!(this as any).figcaption && (this as any).figcaption !== 'undefined') {
                    return (this as any).figcaption;
                  }
      Severity: Minor
      Found in vue/src/components/EpContent/ImageExtension.ts and 1 other location - About 35 mins to fix
      vue/src/components/EpContent/ImageExtension.ts on lines 181..183

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

        case 'koto_opinto':
          node.location = {
            name: 'perusteKotoOpinto',
            params: {
              kotoOpintoId: _.toString(rawNode.id),
      Severity: Major
      Found in vue/src/utils/NavigationBuilder.ts and 36 other locations - About 30 mins to fix
      vue/src/utils/NavigationBuilder.ts on lines 188..195
      vue/src/utils/NavigationBuilder.ts on lines 196..203
      vue/src/utils/NavigationBuilder.ts on lines 262..269
      vue/src/utils/NavigationBuilder.ts on lines 276..283
      vue/src/utils/NavigationBuilder.ts on lines 299..306
      vue/src/utils/NavigationBuilder.ts on lines 307..314
      vue/src/utils/NavigationBuilder.ts on lines 315..322
      vue/src/utils/NavigationBuilder.ts on lines 352..359
      vue/src/utils/NavigationBuilder.ts on lines 360..367
      vue/src/utils/NavigationBuilder.ts on lines 368..375
      vue/src/utils/NavigationBuilder.ts on lines 376..383
      vue/src/utils/NavigationBuilder.ts on lines 384..391
      vue/src/utils/NavigationBuilder.ts on lines 400..407
      vue/src/utils/NavigationBuilder.ts on lines 408..415
      vue/src/utils/NavigationBuilder.ts on lines 416..423
      vue/src/utils/NavigationBuilder.ts on lines 424..431
      vue/src/utils/NavigationBuilder.ts on lines 432..439
      vue/src/utils/NavigationBuilder.ts on lines 440..447
      vue/src/utils/NavigationBuilder.ts on lines 477..484
      vue/src/utils/NavigationBuilder.ts on lines 485..492
      vue/src/utils/NavigationBuilder.ts on lines 493..500
      vue/src/utils/NavigationBuilder.ts on lines 501..508
      vue/src/utils/NavigationBuilder.ts on lines 527..534
      vue/src/utils/NavigationBuilder.ts on lines 568..575
      vue/src/utils/NavigationBuilder.ts on lines 576..583
      vue/src/utils/NavigationBuilder.ts on lines 584..591
      vue/src/utils/NavigationBuilder.ts on lines 592..599
      vue/src/utils/NavigationBuilder.ts on lines 600..607
      vue/src/utils/NavigationBuilder.ts on lines 608..615
      vue/src/utils/NavigationBuilder.ts on lines 640..647
      vue/src/utils/NavigationBuilder.ts on lines 657..664
      vue/src/utils/NavigationBuilder.ts on lines 665..672
      vue/src/utils/NavigationBuilder.ts on lines 673..680
      vue/src/utils/NavigationBuilder.ts on lines 681..688
      vue/src/utils/NavigationBuilder.ts on lines 689..696
      vue/src/utils/NavigationBuilder.ts on lines 697..704

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

      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