Opetushallitus/eperusteet-opintopolku

View on GitHub

Showing 607 of 607 total issues

Avoid too many return statements within this function.
Open

                        return;

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

      {
        path: 'esitys/:perusteId(\\d+)/*/sisalto/:viiteId',
        redirect: (to) => {
          return {
            name: 'perusteTekstikappale',
    Severity: Major
    Found in src/utils/redirects.ts and 6 other locations - About 30 mins to fix
    src/utils/redirects.ts on lines 15..26
    src/utils/redirects.ts on lines 27..38
    src/utils/redirects.ts on lines 39..50
    src/utils/redirects.ts on lines 63..74
    src/utils/redirects.ts on lines 75..86
    src/utils/redirects.ts on lines 113..124

    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

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

      {
        path: 'esitys/:perusteId(\\d+)/*/tutkinnonosat/:tutkinnonOsaViiteId',
        redirect: (to) => {
          return {
            name: 'tutkinnonosa',
    Severity: Major
    Found in src/utils/redirects.ts and 6 other locations - About 30 mins to fix
    src/utils/redirects.ts on lines 27..38
    src/utils/redirects.ts on lines 39..50
    src/utils/redirects.ts on lines 51..62
    src/utils/redirects.ts on lines 63..74
    src/utils/redirects.ts on lines 75..86
    src/utils/redirects.ts on lines 113..124

    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

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

      {
        path: 'esitys/:perusteId(\\d+)/*/rakenne',
        redirect: (to) => {
          return {
            name: 'perusteenRakenne',
    Severity: Major
    Found in src/utils/redirects.ts and 6 other locations - About 30 mins to fix
    src/utils/redirects.ts on lines 15..26
    src/utils/redirects.ts on lines 27..38
    src/utils/redirects.ts on lines 51..62
    src/utils/redirects.ts on lines 63..74
    src/utils/redirects.ts on lines 75..86
    src/utils/redirects.ts on lines 113..124

    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

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

      {
        path: 'esitys/:perusteId(\\d+)/*',
        redirect: (to) => {
          return {
            name: 'perusteTiedot',
    Severity: Major
    Found in src/utils/redirects.ts and 6 other locations - About 30 mins to fix
    src/utils/redirects.ts on lines 15..26
    src/utils/redirects.ts on lines 27..38
    src/utils/redirects.ts on lines 39..50
    src/utils/redirects.ts on lines 51..62
    src/utils/redirects.ts on lines 75..86
    src/utils/redirects.ts on lines 113..124

    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

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

      {
        path: 'esitys/:perusteId(\\d+)/*/tutkinnonosat',
        redirect: (to) => {
          return {
            name: 'tutkinnonosat',
    Severity: Major
    Found in src/utils/redirects.ts and 6 other locations - About 30 mins to fix
    src/utils/redirects.ts on lines 15..26
    src/utils/redirects.ts on lines 39..50
    src/utils/redirects.ts on lines 51..62
    src/utils/redirects.ts on lines 63..74
    src/utils/redirects.ts on lines 75..86
    src/utils/redirects.ts on lines 113..124

    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

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

      {
        path: 'amops/:toteutussuunnitelmaId/osa/:sisaltoviiteId',
        redirect: (to) => {
          return {
            name: 'toteutussuunnitelmaSisalto',
    Severity: Major
    Found in src/utils/redirects.ts and 6 other locations - About 30 mins to fix
    src/utils/redirects.ts on lines 15..26
    src/utils/redirects.ts on lines 27..38
    src/utils/redirects.ts on lines 39..50
    src/utils/redirects.ts on lines 51..62
    src/utils/redirects.ts on lines 63..74
    src/utils/redirects.ts on lines 113..124

    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

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

      {
        path: 'tpo/:perusteId(\\d+)/*',
        redirect: (to) => {
          return {
            name: 'perusteTiedot',
    Severity: Major
    Found in src/utils/redirects.ts and 6 other locations - About 30 mins to fix
    src/utils/redirects.ts on lines 15..26
    src/utils/redirects.ts on lines 27..38
    src/utils/redirects.ts on lines 39..50
    src/utils/redirects.ts on lines 51..62
    src/utils/redirects.ts on lines 63..74
    src/utils/redirects.ts on lines 75..86

    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

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

            const perusteSisalto = perusteSisaltoMap[$scope.vlk._vuosiluokkakokonaisuus]
                ? (<any>perusteSisaltoMap[$scope.vlk._vuosiluokkakokonaisuus]).sisaltoalueet
                : [];
    eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 312..314

    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

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

    export const getKoosteSubheader = (koulutustyyppi): any => {
      return koosteSubheader[koulutustyyppi] !== undefined ? koosteSubheader[koulutustyyppi] : koosteSubheader['default'];
    };
    Severity: Minor
    Found in src/utils/toteutustypes.ts and 2 other locations - About 30 mins to fix
    src/utils/toteutustypes.ts on lines 86..88
    src/utils/toteutustypes.ts on lines 94..96

    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

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

      public static async create(opsId: number, vlkId: number) {
        const result = new OpetussuunnitelmaVuosiluokkakokonaisuusStore(opsId, vlkId);
        await result.init();
        return result;
      }
    Severity: Major
    Found in src/stores/OpetussuunnitelmaVuosiluokkakokonaisuusStore.ts and 3 other locations - About 30 mins to fix
    src/stores/AipeVaiheStore.ts on lines 13..17
    src/stores/PerusopetusOppiaineStore.ts on lines 14..18
    src/stores/PerusteVuosiluokkakokonaisuusStore.ts on lines 13..17

    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

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

            const perusteSisalto = perusteSisaltoMap[$scope.vlk._vuosiluokkakokonaisuus]
                ? (<any>perusteSisaltoMap[$scope.vlk._vuosiluokkakokonaisuus]).sisaltoalueet
                : [];
    eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 444..446

    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

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

                $window.location.href =  "//" + location.host
                    + "/eperusteet-ylops-app/#/" + Kieli.getSisaltokieli()
                    + "/opetussuunnitelmat/"+ $scope.ops.id + "/tiedot";
    Severity: Minor
    Found in eperusteet-opintopolku-app/yo/app/scripts/views/ops/ops.ts and 1 other location - About 30 mins to fix
    eperusteet-opintopolku-app/yo/app/scripts/views/ops/yksinkertainen.ts on lines 65..66

    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

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

    export const getKoosteKuvaus = (koulutustyyppi): any => {
      return koosteKuvaus[koulutustyyppi] !== undefined ? koosteKuvaus[koulutustyyppi] : koosteKuvaus['default'];
    };
    Severity: Minor
    Found in src/utils/toteutustypes.ts and 2 other locations - About 30 mins to fix
    src/utils/toteutustypes.ts on lines 90..92
    src/utils/toteutustypes.ts on lines 94..96

    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

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

            $scope.navi.sections[0].items.unshift({
                depth: 0,
                label: "opetussuunnitelman-tiedot",
                link: ["root.ops.lukioopetus.tiedot"]
            });
    eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 165..169

    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

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

            $scope.navi.sections[0].items.unshift({
                depth: 0,
                label: "opetussuunnitelman-tiedot",
                link: ["root.ops.perusopetus.tiedot"]
            });
    eperusteet-opintopolku-app/yo/app/scripts/views/ops/lukioopetus.ts on lines 122..126

    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

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

        export const tutkinnonosat = (tekstikappaleviitteet: Array<any>) =>
            _.find(tekstikappaleviitteet, tkv => tkv.tyyppi === "tutkinnonosat");
    Severity: Minor
    Found in eperusteet-opintopolku-app/yo/app/data/tekstikappaleet.ts and 1 other location - About 30 mins to fix
    eperusteet-opintopolku-app/yo/app/data/tekstikappaleet.ts on lines 2..3

    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

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

        export const suorituspolut = (tekstikappaleviitteet: Array<any>) =>
            _.find(tekstikappaleviitteet, tkv => tkv.tyyppi === "suorituspolut");
    Severity: Minor
    Found in eperusteet-opintopolku-app/yo/app/data/tekstikappaleet.ts and 1 other location - About 30 mins to fix
    eperusteet-opintopolku-app/yo/app/data/tekstikappaleet.ts on lines 5..6

    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

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

      public static async create(perusteId: number, vlkId: number) {
        const result = new PerusteVuosiluokkakokonaisuusStore(perusteId, vlkId);
        await result.init();
        return result;
      }
    Severity: Major
    Found in src/stores/PerusteVuosiluokkakokonaisuusStore.ts and 3 other locations - About 30 mins to fix
    src/stores/AipeVaiheStore.ts on lines 13..17
    src/stores/OpetussuunnitelmaVuosiluokkakokonaisuusStore.ts on lines 15..19
    src/stores/PerusopetusOppiaineStore.ts on lines 14..18

    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

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

      public static async create(perusteId: number, vaiheId: number) {
        const result = new AipeVaiheStore(perusteId, vaiheId);
        await result.init();
        return result;
      }
    Severity: Major
    Found in src/stores/AipeVaiheStore.ts and 3 other locations - About 30 mins to fix
    src/stores/OpetussuunnitelmaVuosiluokkakokonaisuusStore.ts on lines 15..19
    src/stores/PerusopetusOppiaineStore.ts on lines 14..18
    src/stores/PerusteVuosiluokkakokonaisuusStore.ts on lines 13..17

    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