Opetushallitus/eperusteet-opintopolku

View on GitHub

Showing 607 of 607 total issues

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

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

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

            $scope.toggle = function(items, item, $event, state) {
                if ($event) {
                    $event.preventDefault();
                }
                let index = _.indexOf(items, item);
    eperusteet-opintopolku-app/yo/app/eperusteet-esitys/services/lukiosivunavigaatio.ts on lines 180..196
    eperusteet-opintopolku-app/yo/app/eperusteet-esitys/views/controllers/lukio.ts on lines 499..515

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

    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

            $scope.toggle = function(items, item, $event, state) {
                if ($event) {
                    $event.preventDefault();
                }
                var index = _.indexOf(items, item);
    eperusteet-opintopolku-app/yo/app/eperusteet-esitys/services/sivunavigaatio.ts on lines 170..186
    eperusteet-opintopolku-app/yo/app/eperusteet-esitys/views/controllers/lukio.ts on lines 499..515

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

    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

            $scope.toggle = function(items, item, $event, state) {
                if ($event) {
                    $event.preventDefault();
                }
                var index = _.indexOf(items, item);
    eperusteet-opintopolku-app/yo/app/eperusteet-esitys/services/lukiosivunavigaatio.ts on lines 180..196
    eperusteet-opintopolku-app/yo/app/eperusteet-esitys/services/sivunavigaatio.ts on lines 170..186

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

    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

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

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

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

      export class LopsOpetussuunnitelmaOppiaineStore {
        @State() public opsId: number;
        @State() public oppiaineId: number;
        @State() public oppiaine: LukioOppiaineTiedotDto | null = null;
      
      
      Severity: Major
      Found in src/stores/LopsOpetussuunnitelmaOppiaineStore.ts and 2 other locations - About 1 day to fix
      src/stores/Lops2019OpetussuunnitelmaOppiaineStore.ts on lines 5..25
      src/stores/Lops2019OppiaineStore.ts on lines 5..25

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

      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 class Lops2019OpetussuunnitelmaOppiaineStore {
        @State() public opsId: number;
        @State() public oppiaineId: number;
        @State() public oppiaine: Lops2019OppiaineKaikkiDto | null = null;
      
      
      Severity: Major
      Found in src/stores/Lops2019OpetussuunnitelmaOppiaineStore.ts and 2 other locations - About 1 day to fix
      src/stores/Lops2019OppiaineStore.ts on lines 5..25
      src/stores/LopsOpetussuunnitelmaOppiaineStore.ts on lines 5..25

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

      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 class Lops2019OppiaineStore {
        @State() public perusteId: number;
        @State() public oppiaineId: number;
        @State() public oppiaine: Lops2019OppiaineKaikkiDto | null = null;
      
      
      Severity: Major
      Found in src/stores/Lops2019OppiaineStore.ts and 2 other locations - About 1 day to fix
      src/stores/Lops2019OpetussuunnitelmaOppiaineStore.ts on lines 5..25
      src/stores/LopsOpetussuunnitelmaOppiaineStore.ts on lines 5..25

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

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

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

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

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

      Refactorings

      Further Reading

      Function HakuController has 202 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          export const HakuController = (
              $scope,
              $rootScope,
              $state,
              SpinnerService,
      Severity: Major
      Found in eperusteet-opintopolku-app/yo/app/scripts/views/haku/haku.ts - About 1 day to fix

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

                function updateModel(items, doUncollapse = undefined) {
                    if (!items) {
                        return;
                    }
                    _.each(items, function(item) {
        eperusteet-opintopolku-app/yo/app/eperusteet-esitys/services/sivunavigaatio.ts on lines 146..168

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

        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 updateModel(items, doUncollapse = undefined) {
                    if (!items) {
                        return;
                    }
                    _.each(items, function(item) {
        eperusteet-opintopolku-app/yo/app/eperusteet-esitys/services/lukiosivunavigaatio.ts on lines 156..178

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

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

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

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

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

        Refactorings

        Further Reading

        Function epLukioSivuNaviController has 183 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            export const epLukioSivuNaviController = (
                $rootScope,
                $scope,
                $location,
                $state,

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

                          oppiaine: {
                              index: 1,
                              callback: function(item) {
                                  if (item.$oppiaine) {
                                      item.$selected =
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/opssivunaviutils.ts on lines 193..212

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

          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

                          valinainenoppiaine: {
                              index: 1,
                              callback: function(item) {
                                  if (item.$oppiaine) {
                                      item.$selected =
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/opssivunaviutils.ts on lines 173..192

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

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

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

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

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

          Refactorings

          Further Reading

          Function epSivuNaviController has 178 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              export const epSivuNaviController = (
                  $scope,
                  $state,
                  Algoritmit,
                  Utils,

            File lukio.ts has 460 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

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

              angular.module("app").config($stateProvider => {
                  const YksinkertaistenResolve = {
                      viiteId: function(serviceConfig, $stateParams) {
                          return $stateParams.tekstikappaleId;
                      },
              Severity: Minor
              Found in eperusteet-opintopolku-app/yo/app/states/ops/state.ts - About 6 hrs to fix

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

                              {
                                'kuvaus': null,
                                'vieras': null,
                                'tunniste': '58ddb00b-2ac0-4f21-93ae-f998e3d54580',
                                'pakollinen': false,
                Severity: Major
                Found in src/components/EpAmmatillinen/tests/data.ts and 2 other locations - About 6 hrs to fix
                src/components/EpAmmatillinen/tests/data.ts on lines 239..277
                src/components/EpAmmatillinen/tests/data.ts on lines 277..315

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

                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