Opetushallitus/eperusteet-opintopolku

View on GitHub
eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts

Summary

Maintainability
F
3 wks
Test Coverage

File state.ts has 677 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (c) 2017 The Finnish Board of Education - Opetushallitus
 *
 * This program is free software: Licensed under the EUPL, Version 1.1 or - as
 * soon as they will be approved by the European Commission - subsequent versions

    Function controller has 219 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                    controller(
                        $q,
                        $scope,
                        $rootScope,
                        $state,

      Function controller has 208 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                      controller(
                          $q,
                          $scope,
                          $rootScope,
                          $state,

        Function controller has 118 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        controller(
                            $q,
                            $scope,
                            $rootScope,
                            $state,

          Function controller has 14 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                              $q,
                              $scope,
                              $rootScope,
                              $state,
                              perustehaku,

            Function controller has 14 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                                $q,
                                $scope,
                                $rootScope,
                                $state,
                                perustehaku,

              Function perusteParsinta has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                                  function perusteParsinta(vastaus) {
                                      $scope.perusteet = vastaus;
                                      _.each(vastaus.data, peruste => {
                                          selvitaTila(peruste);
                                          peruste.$$tutkintonimikkeet = {};

                Function perusteParsinta has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                    function perusteParsinta(vastaus) {
                                        $scope.perusteet = vastaus;
                                        _.each(vastaus.data, peruste => {
                                            selvitaTila(peruste);
                                            peruste.$$tutkintonimikkeet = {};

                  Function haePerusteista has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                      async function haePerusteista(hakuparametrit, sivu = 1) {
                                          sivu = sivu - 1;
                                          try {
                                              $scope.isSearching = true;
                                              if (canceler) {

                    Function controller has 12 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                                        $q,
                                        $scope,
                                        $rootScope,
                                        $state,
                                        perustehaku,

                      Function controller has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                      controller($scope, $timeout, $q, $state, koulutustoimijaHaku, Kieli) {
                                          $scope.haku = "";
                                          $scope.isLoading = true;
                                          $scope.koulutustoimijat = [];
                                          $scope.sivu = 1;

                        Function selvitaTila has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                            function selvitaTila(peruste) {
                                                let currentTime = new Date().getTime();
                                                let voimassaoloAlkaa = peruste.voimassaoloAlkaa;
                                                let voimassaoloLoppuu = peruste.voimassaoloLoppuu;
                                                let siirtymaPaattyy = peruste.siirtymaPaattyy;

                          Function selvitaTila has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                              function selvitaTila(peruste) {
                                                  let currentTime = new Date().getTime();
                                                  let voimassaoloAlkaa = peruste.voimassaoloAlkaa;
                                                  let voimassaoloLoppuu = peruste.voimassaoloLoppuu;
                                                  let siirtymaPaattyy = peruste.siirtymaPaattyy;

                            Function haePerusteista has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                                async function haePerusteista(hakuparametrit, sivu = 1) {
                                                    sivu = sivu - 1;
                                                    try {
                                                        $scope.isSearching = true;
                                                        if (canceler) {

                              Function haeKoulutustoimijoista has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                                  async function haeKoulutustoimijoista() {
                                                      $scope.isLoading = true;
                                                      if (canceler) {
                                                          canceler.resolve();
                                                      }

                                Function controller has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                                controller($scope, $timeout, $q, $state, koulutustoimijaHaku, Kieli) {

                                  Avoid too many return statements within this function.
                                  Open

                                                                  return;

                                    Avoid too many return statements within this function.
                                    Open

                                                                    return;

                                      Avoid too many return statements within this function.
                                      Open

                                                              return;

                                        Avoid too many return statements within this function.
                                        Open

                                                                return;

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

                                                              function perusteParsinta(vastaus) {
                                                                  $scope.perusteet = vastaus;
                                                                  _.each(vastaus.data, peruste => {
                                                                      selvitaTila(peruste);
                                                                      peruste.$$tutkintonimikkeet = {};
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 473..516

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

                                          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

                                                              function perusteParsinta(vastaus) {
                                                                  $scope.perusteet = vastaus;
                                                                  _.each(vastaus.data, peruste => {
                                                                      selvitaTila(peruste);
                                                                      peruste.$$tutkintonimikkeet = {};
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 216..259

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

                                          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

                                                              {
                                                                  // Kontrollerin toiminnallisuus
                                                                  // Kutsutaan uib-pagination eventistä
                                                                  $scope.pageChanged = () => haePerusteista($scope.hakuparametrit, $scope.nykyinenSivu);
                                                                  $scope.isArray = _.isArray;
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 371..405

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

                                          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

                                                              {
                                                                  // Kontrollerin toiminnallisuus
                                                                  // Kutsutaan uib-pagination eventistä
                                                                  $scope.pageChanged = () => haePerusteista($scope.hakuparametrit, $scope.nykyinenSivu);
                                                                  $scope.isArray = _.isArray;
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 114..148

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

                                          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

                                                              {
                                                                  // Muuttujat
                                                                  $scope.isSearching = true;
                                                                  $scope.hakuparametrit = hakuparametrit();
                                                                  $scope.nykyinenSivu = 1;
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 89..112

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

                                          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

                                                              {
                                                                  // Muuttujat
                                                                  $scope.isSearching = true;
                                                                  $scope.hakuparametrit = hakuparametrit();
                                                                  $scope.nykyinenSivu = 1;
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 346..369

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

                                          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

                                                              function rakennaKorvauslista(perusteet, avain = "korvattavat-perusteet") {
                                                                  let result = "<div>";
                                                                  result += "<h4>" + KaannaService.kaanna(avain) + "</h4>";
                                                                  let perusteetMapped = [];
                                          
                                          
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 187..213

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

                                          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

                                                              function rakennaKorvauslista(perusteet, avain = "korvattavat-perusteet") {
                                                                  let result = "<div>";
                                                                  result += "<h4>" + KaannaService.kaanna(avain) + "</h4>";
                                                                  let perusteetMapped = [];
                                          
                                          
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 444..470

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

                                          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

                                                              function selvitaTila(peruste) {
                                                                  let currentTime = new Date().getTime();
                                                                  let voimassaoloAlkaa = peruste.voimassaoloAlkaa;
                                                                  let voimassaoloLoppuu = peruste.voimassaoloLoppuu;
                                                                  let siirtymaPaattyy = peruste.siirtymaPaattyy;
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 407..442

                                          Duplicated Code

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

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

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

                                          Tuning

                                          This issue has a mass of 205.

                                          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

                                                              function selvitaTila(peruste) {
                                                                  let currentTime = new Date().getTime();
                                                                  let voimassaoloAlkaa = peruste.voimassaoloAlkaa;
                                                                  let voimassaoloLoppuu = peruste.voimassaoloLoppuu;
                                                                  let siirtymaPaattyy = peruste.siirtymaPaattyy;
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 150..185

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

                                          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

                                                                      if ($scope.hakuparametrit.koulutusala) {
                                                                          $scope.opintoalat = (<any>_.findWhere($scope.koulutusalat, {
                                                                              koodi: $scope.hakuparametrit.koulutusala
                                                                          })).opintoalat;
                                                                          _.each($scope.opintoalat, ala => {
                                          eperusteet-opintopolku-app/yo/app/scripts/views/haku/haku.ts on lines 234..244
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 280..290

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

                                          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

                                                                      if ($scope.hakuparametrit.koulutusala) {
                                                                          $scope.opintoalat = (<any>_.findWhere($scope.koulutusalat, {
                                                                              koodi: $scope.hakuparametrit.koulutusala
                                                                          })).opintoalat;
                                                                          _.each($scope.opintoalat, ala => {
                                          eperusteet-opintopolku-app/yo/app/scripts/views/haku/haku.ts on lines 234..244
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 548..558

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

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

                                                                      perusteParsinta(
                                                                          await perustehaku
                                                                              .withHttpConfig({ timeout: canceler.promise })
                                                                              .get({ ...$scope.hakuparametrit, sivu })
                                                                      );
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 541..545
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 715..719

                                          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

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

                                                                      perusteParsinta(
                                                                          await perustehaku
                                                                              .withHttpConfig({ timeout: canceler.promise })
                                                                              .get({ ...$scope.hakuparametrit, sivu })
                                                                      );
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 274..278
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 541..545

                                          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

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

                                                                          perusteParsinta(
                                                                              await perustehaku
                                                                                  .withHttpConfig({ timeout: canceler.promise })
                                                                                  .get({ ...$scope.hakuparametrit, sivu })
                                                                          );
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 274..278
                                          eperusteet-opintopolku-app/yo/app/states/selaus/ammatillinenkoulutus/state.ts on lines 715..719

                                          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

                                          There are no issues that match your filters.

                                          Category
                                          Status