Opetushallitus/eperusteet-opintopolku

View on GitHub
eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts

Summary

Maintainability
F
6 days
Test Coverage

File perusopetus.ts has 433 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (c) 2013 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
Severity: Minor
Found in eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts - About 6 hrs to fix

    Function setMurupolku has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function setMurupolku() {
                let item: any = _.reduce(
                    $scope.navi.sections[1].items,
                    (result, item: any, index) => {
                        if (item.$selected === true) {
    Severity: Minor
    Found in eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts - About 1 hr to fix

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

              const moveToOppiaine = vuosi => {
                  let vlk = "vuosiluokka_" + vuosi;
                  return getFirstOppiaine(vlk).then(firstOppiaine => {
                      if (_.isObject(firstOppiaine) && firstOppiaine.$tyyppi + "" === "yhteinen") {
                          return $state.go(
      Severity: Minor
      Found in eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts - About 1 hr to fix

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

                $scope.onSectionChange = function(section) {
                    if (section.id === "vlkoppiaine" && !section.$open) {
                        var vlkId = $scope.navi.sections[1].items[1].$vkl.id;
                        $timeout(() => {
                            return $state.go("root.ops.perusopetus.vuosiluokkakokonaisuus", {
        Severity: Minor
        Found in eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts - About 1 hr to fix

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

          angular
              .module("app")
              .controller("OpsPerusopetusController", function(
                  $q,
                  $scope,
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/lukioopetus.ts on lines 17..189

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

          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

                  const getCurrentVlk = vlk => {
                      var vuodet = vlk.nimi.fi.replace(/\D/g, "").split("") || vlk.nimi.sv.replace(/\D/g, "").split("");
                      vuodet = _.map(vuodet, function(v: any) {
                          return parseInt(v);
                      });
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 386..392

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

          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

                  const getCurrentVlk = vlk => {
                      var vuodet = vlk.nimi.fi.replace(/\D/g, "").split("") || vlk.nimi.sv.replace(/\D/g, "").split("");
                      vuodet = _.map(vuodet, function(v: any) {
                          return parseInt(v);
                      });
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 475..481

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

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

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

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

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

          Refactorings

          Further Reading

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

                          if (_.isObject(firstOppiaine) && firstOppiaine.$tyyppi + "" === "yhteinen") {
                              return $state.go(
                                  "root.ops.perusopetus.vuosiluokkakokonaisuus.vuosiluokka.oppiaine",
                                  {
                                      vuosi: vuosi,
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.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 68.

          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

                          } else if (_.isObject(firstOppiaine) && firstOppiaine.$tyyppi + "" !== "yhteinen") {
                              return $state.go(
                                  "root.ops.perusopetus.vuosiluokkakokonaisuus.vuosiluokka.valinainenoppiaine",
                                  {
                                      vuosi: vuosi,
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 102..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 68.

          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

                  const clickHandler = event => {
                      var ohjeEl = angular.element(event.target).closest(".popover, .popover-element");
                      if (ohjeEl.length === 0) {
                          $rootScope.$broadcast("ohje:closeAll");
                      }
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/lukioopetus.ts on lines 54..59
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/yksinkertainen.ts on lines 50..55

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

          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

                  $scope.noYleistavoitteet = () => {
                      if ($scope.vlk && $scope.vlk.yleistavoitteet) {
                          return $scope.vlk.yleistavoitteet.teksti === null;
                      }
                      return true;
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 407..412

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

          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

                  $scope.noYleistavoitteet = () => {
                      if ($scope.vlk && $scope.vlk.yleistavoitteet) {
                          return $scope.vlk.yleistavoitteet.teksti === null;
                      }
                      return true;
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 496..501

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

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

                  $scope.osaamisenKuvauksetTyhjia = function(arvioinninKohteet: any[]) {
                      return _.size(_.filter(arvioinninKohteet, kohde => kohde.arvosana !== null)) === 0;
                  }
          eperusteet-opintopolku-app/yo/app/scripts/peruste/directives/aipe/tavoitteet.ts on lines 80..82
          eperusteet-opintopolku-app/yo/app/scripts/peruste/directives/tavoitteet.ts on lines 160..162
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 339..341

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

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

                  $scope.osaamisenKuvauksetTyhjia = function(arvioinninKohteet: any[]) {
                      return _.size(_.filter(arvioinninKohteet, kohde => kohde.arvosana !== null)) === 0;
                  }
          eperusteet-opintopolku-app/yo/app/scripts/peruste/directives/aipe/tavoitteet.ts on lines 80..82
          eperusteet-opintopolku-app/yo/app/scripts/peruste/directives/tavoitteet.ts on lines 160..162
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 509..511

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

          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

                  $scope.valittuVlk = _.filter(oppiaine.vuosiluokkakokonaisuudet, (vlk: any) => {
                      return vlk._vuosiluokkakokonaisuus == $scope.currentVlk;
                  }).pop();
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 488..490

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

          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

                  $scope.valittuVlk = _.filter(oppiaine.vuosiluokkakokonaisuudet, (vlk: any) => {
                      return vlk._vuosiluokkakokonaisuus == $scope.currentVlk;
                  }).pop();
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 399..401

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

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

                  $scope.hasContent = function(obj) {
                      return _.isObject(obj) && obj.teksti && obj.teksti[Kieli.getSisaltokieli()];
                  };
          eperusteet-opintopolku-app/yo/app/eperusteet-esitys/views/controllers/lukio.ts on lines 118..120
          eperusteet-opintopolku-app/yo/app/eperusteet-esitys/views/controllers/perusopetus.ts on lines 42..44
          eperusteet-opintopolku-app/yo/app/eperusteet-esitys/views/controllers/yksinkertainen.ts on lines 47..49
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/lukioopetus.ts on lines 43..45

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

          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

                  const installClickHandler = () => {
                      $document.off("click", clickHandler);
                      $timeout(() => {
                          $document.on("click", clickHandler);
                      });
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/lukioopetus.ts on lines 61..66
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/yksinkertainen.ts on lines 57..62

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 48.

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

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

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

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

          Refactorings

          Further Reading

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

                          } else {
                              $timeout(() => {
                                  return $state.go("root.ops.perusopetus.valinnaisetoppiaineet", {
                                      opsId: $scope.ops.id,
                                      oppiaineId: oppiaineId
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 194..201

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 47.

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

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

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

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

          Refactorings

          Further Reading

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

                          if (tyyppi === "yhteinen") {
                              $timeout(() => {
                                  return $state.go("root.ops.perusopetus.oppiaineet", {
                                      opsId: $scope.ops.id,
                                      oppiaineId: oppiaineId
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 201..208

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 47.

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

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

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

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

          Refactorings

          Further Reading

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

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

          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

          There are no issues that match your filters.

          Category
          Status