e-ucm/rage-analytics-frontend

View on GitHub
app/public/js/controllers/participantsConf.js

Summary

Maintainability
F
1 wk
Test Coverage

File participantsConf.js has 352 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright 2016 e-UCM (http://www.e-ucm.es/)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
Severity: Minor
Found in app/public/js/controllers/participantsConf.js - About 4 hrs to fix

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

                $ctrl.modifyGroup = function (usr, role, toAdd) {
                    if ($ctrl.selectedGroup) {
                        var route;
                        if (toAdd) {
                            route = CONSTANTS.PROXY + '/classes/groups/' + $ctrl.selectedGroup._id;
    Severity: Minor
    Found in app/public/js/controllers/participantsConf.js - About 1 hr to fix

      Function inviteUser has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  $ctrl.inviteUser = function (role) {
                      var object = {participants: {}};
                      var user;
                      switch (role) {
                          case 'teacher': {
      Severity: Minor
      Found in app/public/js/controllers/participantsConf.js - About 1 hr to fix

        Avoid deeply nested control flow statements.
        Open

                                        if ($ctrl.isInSelectedGroup(id, role, $ctrl.classGroups[j])) {
                                            return true;
                                        }
        Severity: Major
        Found in app/public/js/controllers/participantsConf.js - About 45 mins to fix

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

                      $ctrl.unlockGroups = function() {
                          var route = CONSTANTS.PROXY + '/classes/' + $ctrl.class._id + '/remove';
                          if ($ctrl.unlockedGroupings) {
                              $http.put(route, {groupings: $ctrl.class.groupings}).success(function (data) {
                                  $ctrl.class = data;
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 3 other locations - About 1 day to fix
          app/public/js/controllers/activity.js on lines 377..399
          app/public/js/controllers/activity.js on lines 401..423
          app/public/js/controllers/participantsConf.js on lines 99..121

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

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

                      $ctrl.unlockGroupings = function() {
                          var route = CONSTANTS.PROXY + '/classes/' + $ctrl.class._id + '/remove';
                          if ($ctrl.unlockedGroups) {
                              $http.put(route, {groups: $ctrl.class.groups}).success(function (data) {
                                  $ctrl.class = data;
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 3 other locations - About 1 day to fix
          app/public/js/controllers/activity.js on lines 377..399
          app/public/js/controllers/activity.js on lines 401..423
          app/public/js/controllers/participantsConf.js on lines 75..97

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

          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

                      $ctrl.checkGroup = function (group) {
                          var route = CONSTANTS.PROXY + '/classes/' + $ctrl.class._id;
                          if ($ctrl.class.groups && $ctrl.class.groups.indexOf(group._id) !== -1) {
                              route += '/remove';
                          }
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 2 other locations - About 1 day to fix
          app/public/js/controllers/activity.js on lines 496..507
          app/public/js/controllers/participantsConf.js on lines 136..147

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

          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

                      $ctrl.checkGrouping = function (grouping) {
                          var route = CONSTANTS.PROXY + '/classes/' + $ctrl.class._id;
                          if ($ctrl.class.groupings && $ctrl.class.groupings.indexOf(grouping._id) !== -1) {
                              route += '/remove';
                          }
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 2 other locations - About 1 day to fix
          app/public/js/controllers/activity.js on lines 496..507
          app/public/js/controllers/participantsConf.js on lines 123..134

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

          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

                      $ctrl.isInSelectedGrouping = function (id, role) {
                          if ($ctrl.selectedGrouping) {
                              if (role === 'group') {
                                  return $ctrl.selectedGrouping.groups.indexOf(id) !== -1;
                              }
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 1 other location - About 1 day to fix
          app/public/js/controllers/activity.js on lines 475..494

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

          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

                      $ctrl.removeGroup = function (group) {
                          if (group.name && group.name.trim() !== '') {
                              var route = CONSTANTS.PROXY + '/classes/groups/' + group._id;
                              $http.delete(route).success(function (data) {
                                  updateGroups();
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 1 other location - About 6 hrs to fix
          app/public/js/controllers/participantsConf.js on lines 394..404

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

          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

                      $ctrl.removeGrouping = function (grouping) {
                          if (grouping.name && grouping.name.trim() !== '') {
                              var route = CONSTANTS.PROXY + '/classes/groupings/' + grouping._id;
                              $http.delete(route).success(function (data) {
                                  updateGroupings();
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 1 other location - About 6 hrs to fix
          app/public/js/controllers/participantsConf.js on lines 352..362

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

          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 updateGroupings = function () {
                          var route = CONSTANTS.PROXY + '/classes/' + $ctrl.classId + '/groupings';
                          $http.get(route).success(function (data) {
                              $ctrl.classGroupings = data;
                          }).error(function (data, status) {
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 1 other location - About 4 hrs to fix
          app/public/js/controllers/participantsConf.js on lines 55..63

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

          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 updateGroups = function () {
                          var route = CONSTANTS.PROXY + '/classes/' + $ctrl.classId + '/groups';
                          $http.get(route).success(function (data) {
                              $ctrl.classGroups = data;
                          }).error(function (data, status) {
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 1 other location - About 4 hrs to fix
          app/public/js/controllers/participantsConf.js on lines 65..73

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

          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

                      $ctrl.isInSelectedGroup = function (usr, role, group) {
                          if (group) {
                              return group.participants[role].indexOf(usr) !== -1;
                          }
                          if ($ctrl.selectedGroup) {
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 1 other location - About 2 hrs to fix
          app/public/js/controllers/activity.js on lines 435..443

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

          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

                              $http.put(route, object).success(function (data) {
                                  $ctrl.class = data;
                              }).error(function (data, status) {
                                  console.error('Error on put' + route + ' ' +
                                      JSON.stringify(data) + ', status: ' + status);
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 1 other location - About 2 hrs to fix
          app/public/js/controllers/participantsConf.js on lines 280..285

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

          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

                          $http.put(route, object).success(function (data) {
                              $ctrl.class = data;
                          }).error(function (data, status) {
                              console.error('Error on put' + route + ' ' +
                                  JSON.stringify(data) + ', status: ' + status);
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 1 other location - About 2 hrs to fix
          app/public/js/controllers/participantsConf.js on lines 254..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 91.

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

                      $ctrl.selectGroup = function (group) {
                          if ($ctrl.selectedGroup && $ctrl.selectedGroup._id === group._id) {
                              $ctrl.selectedGroup = undefined;
                          } else {
                              $ctrl.selectedGroup = group;
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 3 other locations - About 2 hrs to fix
          app/public/js/controllers/activity.js on lines 425..433
          app/public/js/controllers/activity.js on lines 445..453
          app/public/js/controllers/participantsConf.js on lines 169..177

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

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

                      $ctrl.selectGrouping = function (grouping) {
                          if ($ctrl.selectedGrouping && $ctrl.selectedGrouping._id === grouping._id) {
                              $ctrl.selectedGrouping = undefined;
                          } else {
                              $ctrl.selectedGrouping = grouping;
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 3 other locations - About 2 hrs to fix
          app/public/js/controllers/activity.js on lines 425..433
          app/public/js/controllers/activity.js on lines 445..453
          app/public/js/controllers/participantsConf.js on lines 149..157

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

          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

                      $ctrl.getGroupThClass = function(group) {
                          if ($ctrl.selectedGroup && $ctrl.selectedGroup._id === group._id) {
                              return 'bg-success';
                          }
                          if ($ctrl.selectedGrouping && $ctrl.isInSelectedGrouping(group._id, 'group')) {
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 1 other location - About 2 hrs to fix
          app/public/js/controllers/activity.js on lines 455..463

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

          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

                      $ctrl.getUserThClass = function(usr, role) {
                          if ($ctrl.selectedGroup && $ctrl.isInSelectedGroup(usr, role)) {
                              return 'bg-success';
                          }
                          if ($ctrl.selectedGrouping && $ctrl.isInSelectedGrouping(usr, role)) {
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 1 other location - About 2 hrs to fix
          app/public/js/controllers/activity.js on lines 465..473

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

          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 (toAdd) {
                                  route = CONSTANTS.PROXY + '/classes/groupings/' + $ctrl.selectedGrouping._id;
                              } else {
                                  route = CONSTANTS.PROXY + '/classes/groupings/' + $ctrl.selectedGrouping._id + '/remove';
                              }
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 1 other location - About 1 hr to fix
          app/public/js/controllers/participantsConf.js on lines 322..326

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

          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 (toAdd) {
                                  route = CONSTANTS.PROXY + '/classes/groups/' + $ctrl.selectedGroup._id;
                              } else {
                                  route = CONSTANTS.PROXY + '/classes/groups/' + $ctrl.selectedGroup._id + '/remove';
                              }
          Severity: Major
          Found in app/public/js/controllers/participantsConf.js and 1 other location - About 1 hr to fix
          app/public/js/controllers/participantsConf.js on lines 379..383

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

          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