Opetushallitus/eperusteet-opintopolku

View on GitHub

Showing 607 of 607 total issues

File fakedata.ts has 1530 lines of code (exceeds 250 allowed). Consider refactoring.
Open

angular.module("app").factory("fakeData", function() {
    var OPSotsikot = {
        id: 14452,
        tekstiKappale: null,
        omistussuhde: "oma",

    Function mockRakenne has 744 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function mockRakenne() {
      return {
        'kuvaus': {
          '_tunniste': '1869c9e3-40ec-4d8d-b678-753e5c8ed80a',
          'fi': '<p>Tieto- ja tietoliikennetekniikan perustutkinnon laajuus on 180 osaamispistettä. Tutkinto muodostuu ammatillisista tutkinnon osista (145 osaamispistettä) ja yhteisistä tutkinnon osista (35 osaamispistettä). Ammatillisista tutkinnon osista pakollisia on 85—105 osaamispistettä ja valinnaisia 40—60 osaamispistettä.</p>\n\n<p>Tieto- ja tietoliikennetekniikan perustutkinnon tutkintonimikkeet ovat elektroniikka-asentaja, ICT-asentaja ja hyvinvointiteknologia-asentaja.</p>',
    Severity: Major
    Found in src/components/EpAmmatillinen/tests/data.ts - About 3 days to fix

      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

                          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

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

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

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

                var doRefresh = function(items) {
                    var levels = {};
                    if (items.length && !items[0].root) {
                        items.unshift({ root: true, depth: -1 });
                    }
        eperusteet-opintopolku-app/yo/app/eperusteet-esitys/services/lukiosivunavigaatio.ts on lines 101..124
        eperusteet-opintopolku-app/yo/app/eperusteet-esitys/services/sivunavigaatio.ts on lines 88..110

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

        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 doRefresh = function(items) {
                    const levels = {};
                    if (items.length && !items[0].root) {
                        items.unshift({ root: true, depth: -1 });
                    }
        eperusteet-opintopolku-app/yo/app/eperusteet-esitys/services/lukiosivunavigaatio.ts on lines 101..124
        eperusteet-opintopolku-app/yo/app/eperusteet-esitys/views/controllers/lukio.ts on lines 422..444

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

        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

                var doRefresh = function(items) {
                    var levels = {};
                    if (items.length && !items[0].root) {
                        items.unshift({ root: true, depth: -1 });
                    }
        eperusteet-opintopolku-app/yo/app/eperusteet-esitys/services/sivunavigaatio.ts on lines 88..110
        eperusteet-opintopolku-app/yo/app/eperusteet-esitys/views/controllers/lukio.ts on lines 422..444

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

        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

        File data.ts has 746 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        export function mockRakenne() {
          return {
            'kuvaus': {
              '_tunniste': '1869c9e3-40ec-4d8d-b678-753e5c8ed80a',
              'fi': '<p>Tieto- ja tietoliikennetekniikan perustutkinnon laajuus on 180 osaamispistettä. Tutkinto muodostuu ammatillisista tutkinnon osista (145 osaamispistettä) ja yhteisistä tutkinnon osista (35 osaamispistettä). Ammatillisista tutkinnon osista pakollisia on 85—105 osaamispistettä ja valinnaisia 40—60 osaamispistettä.</p>\n\n<p>Tieto- ja tietoliikennetekniikan perustutkinnon tutkintonimikkeet ovat elektroniikka-asentaja, ICT-asentaja ja hyvinvointiteknologia-asentaja.</p>',
        Severity: Major
        Found in src/components/EpAmmatillinen/tests/data.ts - About 1 day to fix

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

          angular
              .module("app")
              .controller("OpsLukioopetusController", function(
                  $scope,
                  $rootScope,
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/perusopetus.ts on lines 17..244

          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

          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

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

                              {
                                  id: 14456,
                                  tekstiKappale: {
                                      id: 14465,
                                      luotu: 1447318256816,
          eperusteet-opintopolku-app/yo/app/scripts/peruste/resources/fakedata.ts on lines 71..138
          eperusteet-opintopolku-app/yo/app/scripts/peruste/resources/fakedata.ts on lines 278..345

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

          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

                                      {
                                          id: 14455,
                                          tekstiKappale: {
                                              id: 14464,
                                              luotu: 1447318245698,
          eperusteet-opintopolku-app/yo/app/scripts/peruste/resources/fakedata.ts on lines 142..209
          eperusteet-opintopolku-app/yo/app/scripts/peruste/resources/fakedata.ts on lines 278..345

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

          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

              var rakennaVuosiluokkakokonaisuuksienMenu = function(vlkt, aineet) {
                  vlkMap = _.indexBy(vlkt, "_tunniste");
                  var vlkWithYears = createMenuByYear(vlkt);
                  var arr = [];
                  var lastVlk = null;
          eperusteet-opintopolku-app/yo/app/scripts/common/services/opsmenubuilders.ts on lines 42..77

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

          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 rakennaVuosiluokkakokonaisuuksienMenu = (vlkt, aineet) => {
                  vlkMap = _.indexBy(vlkt, "_tunniste");
                  let vlkWithYears = createMenuByYear(vlkt);
                  let arr = [];
                  let lastVlk = null;
          eperusteet-opintopolku-app/yo/app/scripts/views/ops/opsutils.ts on lines 53..87

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

          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

                              {
                                  id: 14458,
                                  tekstiKappale: {
                                      id: 14467,
                                      luotu: 1447318331665,
          eperusteet-opintopolku-app/yo/app/scripts/peruste/resources/fakedata.ts on lines 71..138
          eperusteet-opintopolku-app/yo/app/scripts/peruste/resources/fakedata.ts on lines 142..209

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

          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.search = {
                      term: "",
                      update: function() {
                          let matchCount = 0;
                          let items = $scope.items;
          eperusteet-opintopolku-app/yo/app/eperusteet-esitys/services/sivunavigaatio.ts on lines 30..58

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

          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.search = {
                      term: "",
                      update: function() {
                          let matchCount = 0;
                          let items = $scope.items;
          eperusteet-opintopolku-app/yo/app/eperusteet-esitys/services/lukiosivunavigaatio.ts on lines 48..76

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

          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