Opetushallitus/eperusteet-opintopolku

View on GitHub
src/router.ts

Summary

Maintainability
F
6 days
Test Coverage

File router.ts has 940 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import _ from 'lodash';
import Vue from 'vue';
import Router from 'vue-router';
import VueScrollTo from 'vue-scrollto';
import VueMeta from 'vue-meta';
Severity: Major
Found in src/router.ts - About 2 days to fix

    Function scrollBehavior has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      scrollBehavior: (to, from, savedPosition) => {
        if (savedPosition) {
          return savedPosition;
        }
        const elementId = to.hash.substring(1);
    Severity: Minor
    Found in src/router.ts - About 1 hr to fix

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

        scrollBehavior: (to, from, savedPosition) => {
          if (savedPosition) {
            return savedPosition;
          }
          const elementId = to.hash.substring(1);
      Severity: Minor
      Found in src/router.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

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

              meta: {
                resolve: {
                  cacheBy: ['toteutussuunnitelmaId'],
                  async props(route) {
                    return {
      Severity: Major
      Found in src/router.ts and 2 other locations - About 2 hrs to fix
      src/router.ts on lines 492..506
      src/router.ts on lines 571..582

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

      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

              meta: {
                resolve: {
                  cacheBy: ['perusteId'],
                  async props(route) {
                    return {
      Severity: Major
      Found in src/router.ts and 2 other locations - About 2 hrs to fix
      src/router.ts on lines 423..437
      src/router.ts on lines 492..506

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

      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

              meta: {
                resolve: {
                  cacheBy: ['opetussuunnitelmaId'],
                  async props(route) {
                    return {
      Severity: Major
      Found in src/router.ts and 2 other locations - About 2 hrs to fix
      src/router.ts on lines 423..437
      src/router.ts on lines 571..582

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

      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

              }, {
                path: 'aihekokonaisuudet/:aihekokonaisuudetId',
                component: RouteAihekokonaisuudet,
                name: 'perusteAihekokonaisuudet',
                meta: {
      Severity: Major
      Found in src/router.ts and 11 other locations - About 1 hr to fix
      src/router.ts on lines 688..702
      src/router.ts on lines 702..716
      src/router.ts on lines 716..730
      src/router.ts on lines 730..744
      src/router.ts on lines 744..759
      src/router.ts on lines 759..773
      src/router.ts on lines 773..787
      src/router.ts on lines 787..801
      src/router.ts on lines 801..815
      src/router.ts on lines 829..843
      src/router.ts on lines 843..857

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

      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

              }, {
                path: 'osaamiskokonaisuuspaaalue/:osaamiskokonaisuusPaaAlueId',
                component: RouteOsaamiskokonaisuusPaaAlue,
                name: 'perusteOsaamiskokonaisuusPaaAlue',
                meta: {
      Severity: Major
      Found in src/router.ts and 11 other locations - About 1 hr to fix
      src/router.ts on lines 688..702
      src/router.ts on lines 702..716
      src/router.ts on lines 716..730
      src/router.ts on lines 730..744
      src/router.ts on lines 744..759
      src/router.ts on lines 759..773
      src/router.ts on lines 773..787
      src/router.ts on lines 787..801
      src/router.ts on lines 801..815
      src/router.ts on lines 815..829
      src/router.ts on lines 829..843

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

      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

              }, {
                path: 'tavoitesisaltoalue/:tavoitesisaltoalueId',
                component: RouteTavoitesisaltoalue,
                name: 'perusteTavoitesisaltoalue',
                meta: {
      Severity: Major
      Found in src/router.ts and 11 other locations - About 1 hr to fix
      src/router.ts on lines 688..702
      src/router.ts on lines 716..730
      src/router.ts on lines 730..744
      src/router.ts on lines 744..759
      src/router.ts on lines 759..773
      src/router.ts on lines 773..787
      src/router.ts on lines 787..801
      src/router.ts on lines 801..815
      src/router.ts on lines 815..829
      src/router.ts on lines 829..843
      src/router.ts on lines 843..857

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

      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

              }, {
                path: 'osaamiskokonaisuus/:osaamiskokonaisuusId',
                component: RouteOsaamiskokonaisuus,
                name: 'perusteOsaamiskokonaisuus',
                meta: {
      Severity: Major
      Found in src/router.ts and 11 other locations - About 1 hr to fix
      src/router.ts on lines 688..702
      src/router.ts on lines 702..716
      src/router.ts on lines 716..730
      src/router.ts on lines 730..744
      src/router.ts on lines 744..759
      src/router.ts on lines 759..773
      src/router.ts on lines 773..787
      src/router.ts on lines 787..801
      src/router.ts on lines 801..815
      src/router.ts on lines 815..829
      src/router.ts on lines 843..857

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

      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

              }, {
                path: 'yleisettavoitteet/:yleistavoiteId',
                component: RouteYleisettavoitteet,
                name: 'perusteYleisettavoitteet',
                meta: {
      Severity: Major
      Found in src/router.ts and 11 other locations - About 1 hr to fix
      src/router.ts on lines 688..702
      src/router.ts on lines 702..716
      src/router.ts on lines 716..730
      src/router.ts on lines 730..744
      src/router.ts on lines 744..759
      src/router.ts on lines 759..773
      src/router.ts on lines 773..787
      src/router.ts on lines 787..801
      src/router.ts on lines 815..829
      src/router.ts on lines 829..843
      src/router.ts on lines 843..857

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

      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

              }, {
                path: 'koto/kielitaitotaso/:kotokielitaitotasoId',
                component: RouteKotoKielitaitotaso,
                name: 'perusteKotoKielitaitotaso',
                meta: {
      Severity: Major
      Found in src/router.ts and 11 other locations - About 1 hr to fix
      src/router.ts on lines 688..702
      src/router.ts on lines 702..716
      src/router.ts on lines 716..730
      src/router.ts on lines 730..744
      src/router.ts on lines 759..773
      src/router.ts on lines 773..787
      src/router.ts on lines 787..801
      src/router.ts on lines 801..815
      src/router.ts on lines 815..829
      src/router.ts on lines 829..843
      src/router.ts on lines 843..857

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

      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

              }, {
                path: 'koulutuksenosa/:koulutuksenosaId',
                component: RouteKoulutuksenOsa,
                name: 'perusteKoulutuksenOsa',
                meta: {
      Severity: Major
      Found in src/router.ts and 11 other locations - About 1 hr to fix
      src/router.ts on lines 688..702
      src/router.ts on lines 702..716
      src/router.ts on lines 730..744
      src/router.ts on lines 744..759
      src/router.ts on lines 759..773
      src/router.ts on lines 773..787
      src/router.ts on lines 787..801
      src/router.ts on lines 801..815
      src/router.ts on lines 815..829
      src/router.ts on lines 829..843
      src/router.ts on lines 843..857

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

      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

              }, {
                path: 'koto/opinto/:kotoOpintoId',
                component: RouteKotoOpinto,
                name: 'perusteKotoOpinto',
                meta: {
      Severity: Major
      Found in src/router.ts and 11 other locations - About 1 hr to fix
      src/router.ts on lines 688..702
      src/router.ts on lines 702..716
      src/router.ts on lines 716..730
      src/router.ts on lines 730..744
      src/router.ts on lines 744..759
      src/router.ts on lines 773..787
      src/router.ts on lines 787..801
      src/router.ts on lines 801..815
      src/router.ts on lines 815..829
      src/router.ts on lines 829..843
      src/router.ts on lines 843..857

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

      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

              }, {
                path: 'koto/laajaalainenosaaminen/:kotoLaajaalainenOsaaminenId',
                component: RouteKotoLaajaAlainenOsaaminen,
                name: 'perusteKotoLaajaalainenOsaaminen',
                meta: {
      Severity: Major
      Found in src/router.ts and 11 other locations - About 1 hr to fix
      src/router.ts on lines 688..702
      src/router.ts on lines 702..716
      src/router.ts on lines 716..730
      src/router.ts on lines 730..744
      src/router.ts on lines 744..759
      src/router.ts on lines 759..773
      src/router.ts on lines 787..801
      src/router.ts on lines 801..815
      src/router.ts on lines 815..829
      src/router.ts on lines 829..843
      src/router.ts on lines 843..857

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

      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

              }, {
                path: 'linkkisivu/:linkkisivuId',
                component: RouteLinkkisivu,
                name: 'linkkisivu',
                meta: {
      Severity: Major
      Found in src/router.ts and 11 other locations - About 1 hr to fix
      src/router.ts on lines 688..702
      src/router.ts on lines 702..716
      src/router.ts on lines 716..730
      src/router.ts on lines 730..744
      src/router.ts on lines 744..759
      src/router.ts on lines 759..773
      src/router.ts on lines 773..787
      src/router.ts on lines 801..815
      src/router.ts on lines 815..829
      src/router.ts on lines 829..843
      src/router.ts on lines 843..857

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

      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

              }, {
                path: 'laajaalainenosaaminen/:laajaalainenosaaminenId',
                component: RouteLaajaalainenOsaaminen,
                name: 'perusteLaajaalainenOsaaminen',
                meta: {
      Severity: Major
      Found in src/router.ts and 11 other locations - About 1 hr to fix
      src/router.ts on lines 688..702
      src/router.ts on lines 702..716
      src/router.ts on lines 716..730
      src/router.ts on lines 744..759
      src/router.ts on lines 759..773
      src/router.ts on lines 773..787
      src/router.ts on lines 787..801
      src/router.ts on lines 801..815
      src/router.ts on lines 815..829
      src/router.ts on lines 829..843
      src/router.ts on lines 843..857

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

      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

              }, {
                path: 'opintokokonaisuus/:opintokokonaisuusId',
                component: RouteOpintokokonaisuus,
                name: 'perusteOpintokokonaisuus',
                meta: {
      Severity: Major
      Found in src/router.ts and 11 other locations - About 1 hr to fix
      src/router.ts on lines 702..716
      src/router.ts on lines 716..730
      src/router.ts on lines 730..744
      src/router.ts on lines 744..759
      src/router.ts on lines 759..773
      src/router.ts on lines 773..787
      src/router.ts on lines 787..801
      src/router.ts on lines 801..815
      src/router.ts on lines 815..829
      src/router.ts on lines 829..843
      src/router.ts on lines 843..857

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

      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

            }, {
              path: 'ajankohtaista/:tiedoteId(\\d+)',
              name: 'uutinen',
              component: RouteUutinen,
              meta: {
      Severity: Major
      Found in src/router.ts and 1 other location - About 1 hr to fix
      src/router.ts on lines 380..397

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

      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

            }, {
              path: 'ajankohtaista',
              name: 'uutiset',
              component: RouteUutiset,
              meta: {
      Severity: Major
      Found in src/router.ts and 1 other location - About 1 hr to fix
      src/router.ts on lines 397..414

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

      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