Cloud-CV/EvalAI

View on GitHub
frontend/src/js/route-config/route-config.js

Summary

Maintainability
F
1 wk
Test Coverage

Function configure has 578 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function configure($stateProvider, $urlRouterProvider, $locationProvider, $urlMatcherFactoryProvider) {

        //in order to prevent 404 for trailing '/' in urls
        $urlMatcherFactoryProvider.strictMode(false);

Severity: Major
Found in frontend/src/js/route-config/route-config.js - About 2 days to fix

    File route-config.js has 680 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Config for the router
     */
    
    (function () {
    Severity: Major
    Found in frontend/src/js/route-config/route-config.js - About 1 day to fix

      Function runFunc has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function runFunc($rootScope, $state, utilities, $window, $location, toaster) {
              // setting timout for token (7days)
              // var getTokenTime = utilities.getData('tokenTime');
              // var timeNow = (new Date()).getTime();
              // .getTime() returns milliseconds, so for 7 days 1000 * 60 * 60 * 24 * 7 = 7 days
      Severity: Major
      Found in frontend/src/js/route-config/route-config.js - About 3 hrs to fix

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

            function runFunc($rootScope, $state, utilities, $window, $location, toaster) {
        Severity: Minor
        Found in frontend/src/js/route-config/route-config.js - About 45 mins to fix

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

                      resolve: {
                        challenge: function(utilities, $state, $stateParams) {
                          return new Promise(function(resolve, reject) {
                            var parameters = {};
                            parameters.token = utilities.getData('userKey');
          Severity: Major
          Found in frontend/src/js/route-config/route-config.js and 1 other location - About 1 day to fix
          frontend/src/js/route-config/route-config.js on lines 352..377

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

          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

                      resolve: {
                        challenge: function(utilities, $state, $stateParams) {
                          return new Promise(function(resolve, reject) {
                            var parameters = {};
                            parameters.token = utilities.getData('userKey');
          Severity: Major
          Found in frontend/src/js/route-config/route-config.js and 1 other location - About 1 day to fix
          frontend/src/js/route-config/route-config.js on lines 282..307

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

          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

                          onSuccess: function() {
                              utilities.resetStorage();
                              $rootScope.isLoader = false;
                              $state.go("home");
                              $rootScope.isAuth = false;
          Severity: Major
          Found in frontend/src/js/route-config/route-config.js and 1 other location - About 1 hr to fix
          frontend/src/js/controllers/profileCtrl.js on lines 367..373

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

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

                  var challenge_create = {
                      name: "web.challenge-create",
                      parent: "web",
                      url: "/challenge-create",
                      templateUrl: baseUrl + "/web/challenge-create.html",
          Severity: Major
          Found in frontend/src/js/route-config/route-config.js and 7 other locations - About 50 mins to fix
          frontend/src/js/route-config/route-config.js on lines 110..119
          frontend/src/js/route-config/route-config.js on lines 121..130
          frontend/src/js/route-config/route-config.js on lines 132..141
          frontend/src/js/route-config/route-config.js on lines 143..152
          frontend/src/js/route-config/route-config.js on lines 154..163
          frontend/src/js/route-config/route-config.js on lines 457..466
          frontend/src/js/route-config/route-config.js on lines 468..477

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

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

                  var teams = {
                      name: "web.teams",
                      parent: "web",
                      url: "/teams",
                      templateUrl: baseUrl + "/web/teams.html",
          Severity: Major
          Found in frontend/src/js/route-config/route-config.js and 7 other locations - About 50 mins to fix
          frontend/src/js/route-config/route-config.js on lines 110..119
          frontend/src/js/route-config/route-config.js on lines 132..141
          frontend/src/js/route-config/route-config.js on lines 143..152
          frontend/src/js/route-config/route-config.js on lines 154..163
          frontend/src/js/route-config/route-config.js on lines 165..174
          frontend/src/js/route-config/route-config.js on lines 457..466
          frontend/src/js/route-config/route-config.js on lines 468..477

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

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

                  var dashboard = {
                      name: "web.dashboard",
                      parent: "web",
                      url: "/dashboard",
                      templateUrl: baseUrl + "/web/dashboard.html",
          Severity: Major
          Found in frontend/src/js/route-config/route-config.js and 7 other locations - About 50 mins to fix
          frontend/src/js/route-config/route-config.js on lines 121..130
          frontend/src/js/route-config/route-config.js on lines 132..141
          frontend/src/js/route-config/route-config.js on lines 143..152
          frontend/src/js/route-config/route-config.js on lines 154..163
          frontend/src/js/route-config/route-config.js on lines 165..174
          frontend/src/js/route-config/route-config.js on lines 457..466
          frontend/src/js/route-config/route-config.js on lines 468..477

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

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

                  var host_analytics = {
                      name: "web.host-analytics",
                      parent: "web",
                      url: "/host-analytics",
                      templateUrl: baseUrl + "/web/analytics/host-analytics.html",
          Severity: Major
          Found in frontend/src/js/route-config/route-config.js and 7 other locations - About 50 mins to fix
          frontend/src/js/route-config/route-config.js on lines 110..119
          frontend/src/js/route-config/route-config.js on lines 121..130
          frontend/src/js/route-config/route-config.js on lines 132..141
          frontend/src/js/route-config/route-config.js on lines 154..163
          frontend/src/js/route-config/route-config.js on lines 165..174
          frontend/src/js/route-config/route-config.js on lines 457..466
          frontend/src/js/route-config/route-config.js on lines 468..477

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

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

                  var challenge_host_teams = {
                      name: "web.challenge-host-teams",
                      parent: "web",
                      url: "/challenge-host-teams",
                      templateUrl: baseUrl + "/web/challenge-host-teams.html",
          Severity: Major
          Found in frontend/src/js/route-config/route-config.js and 7 other locations - About 50 mins to fix
          frontend/src/js/route-config/route-config.js on lines 110..119
          frontend/src/js/route-config/route-config.js on lines 121..130
          frontend/src/js/route-config/route-config.js on lines 132..141
          frontend/src/js/route-config/route-config.js on lines 143..152
          frontend/src/js/route-config/route-config.js on lines 165..174
          frontend/src/js/route-config/route-config.js on lines 457..466
          frontend/src/js/route-config/route-config.js on lines 468..477

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

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

                  var permission_denied = {
                      name: "web.permission-denied",
                      parent: "web",
                      url: "/permission-denied",
                      templateUrl: baseUrl + "/web/permission-denied.html",
          Severity: Major
          Found in frontend/src/js/route-config/route-config.js and 7 other locations - About 50 mins to fix
          frontend/src/js/route-config/route-config.js on lines 110..119
          frontend/src/js/route-config/route-config.js on lines 121..130
          frontend/src/js/route-config/route-config.js on lines 132..141
          frontend/src/js/route-config/route-config.js on lines 143..152
          frontend/src/js/route-config/route-config.js on lines 154..163
          frontend/src/js/route-config/route-config.js on lines 165..174
          frontend/src/js/route-config/route-config.js on lines 468..477

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

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

                  var hosted_challenges = {
                      name: "web.hosted-challenge",
                      parent: "web",
                      url: "/hosted-challenges",
                      templateUrl: baseUrl + "/web/hosted-challenges.html",
          Severity: Major
          Found in frontend/src/js/route-config/route-config.js and 7 other locations - About 50 mins to fix
          frontend/src/js/route-config/route-config.js on lines 110..119
          frontend/src/js/route-config/route-config.js on lines 121..130
          frontend/src/js/route-config/route-config.js on lines 143..152
          frontend/src/js/route-config/route-config.js on lines 154..163
          frontend/src/js/route-config/route-config.js on lines 165..174
          frontend/src/js/route-config/route-config.js on lines 457..466
          frontend/src/js/route-config/route-config.js on lines 468..477

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

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

                  var change_password = {
                      name: "web.profile.change-password",
                      parent: "web.profile",
                      url: "/change-password",
                      templateUrl: baseUrl + "/web/change-password.html",
          Severity: Major
          Found in frontend/src/js/route-config/route-config.js and 7 other locations - About 50 mins to fix
          frontend/src/js/route-config/route-config.js on lines 110..119
          frontend/src/js/route-config/route-config.js on lines 121..130
          frontend/src/js/route-config/route-config.js on lines 132..141
          frontend/src/js/route-config/route-config.js on lines 143..152
          frontend/src/js/route-config/route-config.js on lines 154..163
          frontend/src/js/route-config/route-config.js on lines 165..174
          frontend/src/js/route-config/route-config.js on lines 457..466

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

          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 challenge_page = {
                      name: "web.challenge-main.challenge-page",
                      parent: "web.challenge-main",
                      url: "/challenge-page/:challengeId",
                      templateUrl: baseUrl + "/web/challenge/challenge-page.html",
          Severity: Minor
          Found in frontend/src/js/route-config/route-config.js and 1 other location - About 35 mins to fix
          frontend/src/js/route-config/route-config.js on lines 184..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 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

                  var challenge_list = {
                      name: "web.challenge-main.challenge-list",
                      parent: "web.challenge-main",
                      url: "/list",
                      templateUrl: baseUrl + "/web/challenge-list.html",
          Severity: Minor
          Found in frontend/src/js/route-config/route-config.js and 1 other location - About 35 mins to fix
          frontend/src/js/route-config/route-config.js on lines 194..202

          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

          There are no issues that match your filters.

          Category
          Status