BerniWittmann/spielplanismaning

View on GitHub

Showing 181 of 353 total issues

Function getTeamDisplay has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            spiel.getTeamDisplay = function (game, teamStr) {
                if (game['team' + teamStr]) {
                    if (game['team' + teamStr].isPlaceholder && !game['team' + teamStr].name) {
                        const t = teams.find(function (single) {
                            return single._id.toString() === game['team' + teamStr]._id.toString();
Severity: Minor
Found in src/public/services/spiel.js - About 1 hr to fix

    Function resetPunkte has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    SpielSchema.methods.resetPunkte = function (cb) {
        const beachEventID = cls.getBeachEventID();
        const clsSession = cls.getNamespace();
        const self = this;
        return clsSession.run(function () {
    Severity: Minor
    Found in src/models/Spiele.js - About 1 hr to fix

      Function SpielController has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          function SpielController($state, aktivesSpiel, spiel, spielModus, auth, $stateParams, toastr, spielplanEnabled) {
      Severity: Major
      Found in src/public/templates/event/spiel/spiel.ui.js - About 1 hr to fix

        Function SlugsContoller has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            function SlugsContoller(jugenden, gruppen, teams, NgTableParams, $state, $scope, auth, veranstaltungen) {
        Severity: Major
        Found in src/public/templates/event/verwaltung/slugs/slugs.js - About 1 hr to fix

          Function getTeam has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function getTeam(gruppe, gegner, geradeSpielendeTeams, lastPlayingTeams, spiele, name, i) {
          Severity: Major
          Found in src/routes/spielplanGenerator/helper.js - About 50 mins to fix

            Function prepareField has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function prepareField(key, storeKey, store, spiel, index, errMessage, cb) {
            Severity: Major
            Found in src/routes/spielImporter/importer.js - About 50 mins to fix

              Function VerwaltungSpielplanController has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  function VerwaltungSpielplanController(spielplan, zeiten, $scope, toastr, spiele, spiel, spielplanEnabled) {

                Function SpielplanSingleSpielController has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    function SpielplanSingleSpielController($scope, $state, auth, spiel, BestaetigenDialog, $timeout, $rootScope) {

                  Function BugMailController has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      function BugMailController($uibModalInstance, $timeout, email, version, env, username, role) {
                  Severity: Major
                  Found in src/public/components/bug-modal/bug-modal.js - About 50 mins to fix

                    Function checkLockdown has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        function checkLockdown($q, auth, $state, $timeout, config, toState, $rootScope) {
                    Severity: Major
                    Found in src/public/app.js - About 50 mins to fix

                      Function execute has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        function execute(model, docs, paths, options, defaultOptions, lean, cb) {
                      Severity: Major
                      Found in src/config/mongoose-deep-populate.js - About 50 mins to fix

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

                            function SpieleDruckController($state, spiele, spiel, $scope, $rootScope, mannschaftslisten) {

                          Function exports has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          module.exports = function (app, secret) {
                              const logger = require('winston').loggers.get('middlewareAuthorization');
                              const messages = require('./../messages/messages.js')();
                              const jwt = require('jsonwebtoken');
                              const _ = require('lodash');
                          Severity: Minor
                          Found in src/routes/middleware/authorization.js - About 45 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

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

                              function EmailAbonnementsContoller(email, BestaetigenDialog, NgTableParams, $state, subscribers, spielplanEnabled) {

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

                                function TeamAbonnierenController($state, $uibModalInstance, gewTeam, email, $rootScope, $timeout) {
                            Severity: Minor
                            Found in src/public/components/team-abonnieren-modal/team-abonnieren-modal.js - About 45 mins to fix

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

                              function createSpielFromSpiel(spielA, spielB, rankA, rankB, jugendid, label) {
                              Severity: Minor
                              Found in src/routes/spielplanGenerator/helper.js - About 45 mins to fix

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

                                    function isValidToken($stateParams, $q, $state, toastr, $timeout, auth) {
                                Severity: Minor
                                Found in src/public/templates/shared/password-reset/password-reset.js - About 45 mins to fix

                                  Function getRequiredRouteConfig has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function getRequiredRouteConfig(routes, path, method, configKey) {
                                      logger.silly('Getting Route Config');
                                      path = removeLastSlashFromPath(path);
                                      let route = routes[path];
                                  
                                  
                                  Severity: Minor
                                  Found in src/routes/helpers.js - About 45 mins to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

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

                                      function AddZwischengruppeController($scope, $uibModalInstance, gewJugend, gruppe, $rootScope, $timeout) {

                                    Consider simplifying this complex logical expression.
                                    Open

                                                                    if (foundSpiel.teamA && foundSpiel.teamA._id &&
                                                                        foundSpiel.teamB && foundSpiel.teamB._id &&
                                                                        foundSpiel.gewinner && foundSpiel.gewinner._id) {
                                                                        if (foundSpiel.teamA._id.toString() === foundSpiel.gewinner._id.toString()) {
                                                                            calculatedTeams[letter] = foundSpiel.teamB;
                                    Severity: Major
                                    Found in src/routes/helpers.js - About 40 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language