BerniWittmann/spielplanismaning

View on GitHub

Showing 181 of 353 total issues

Function SlugsContoller has 108 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function SlugsContoller(jugenden, gruppen, teams, NgTableParams, $state, $scope, auth, veranstaltungen) {
        const vm = this;
        vm.loading = true;
        const originalTooltipText = 'Klick zum Kopieren';

Severity: Major
Found in src/public/templates/event/verwaltung/slugs/slugs.js - About 4 hrs to fix

    Function exports has 106 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function () {
        const logger = require('winston').loggers.get('apiSpiele');
        const express = require('express');
        const router = express.Router();
        const cls = require('../config/cls.js');
    Severity: Major
    Found in src/routes/spielplan.js - About 4 hrs to fix

      Function SpielController has 101 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function SpielController($state, aktivesSpiel, spiel, spielModus, auth, $stateParams, toastr, spielplanEnabled) {
              const vm = this;
              vm.loading = true;
      
              if (!aktivesSpiel.complex || !aktivesSpiel.complex.hz1 || !aktivesSpiel.complex.hz2 || !aktivesSpiel.complex.hz3) {
      Severity: Major
      Found in src/public/templates/event/spiel/spiel.ui.js - About 4 hrs to fix

        Function exports has 98 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function (secret) {
            const mongoose = require('mongoose');
            const crypto = require('crypto');
            const jwt = require('jsonwebtoken');
            const moment = require('moment');
        Severity: Major
        Found in src/models/Users.js - About 3 hrs to fix

          Function AddZwischengruppeController has 90 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function AddZwischengruppeController($scope, $uibModalInstance, gewJugend, gruppe, $rootScope, $timeout) {
                  const vm = this;
          
                  if($rootScope.spielplanEnabled) {
                      $timeout(function () {

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

            module.exports = function (sendgrid, env, url, disableMails) {
                const logger = require('winston').loggers.get('mailGenerator');
                const _ = require('lodash');
                const constants = require('./constants.js');
                const ejs = require('ejs');
            Severity: Minor
            Found in src/routes/mailGenerator/mailGenerator.js - About 3 hrs 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 generateZwischenGruppen has 88 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function generateZwischenGruppen(gruppen, jugendid, maxTeamsAdvance, callback) {
                const gruppenLength = gruppen.length;
                const relevantGruppen = [];
                if (gruppenLength <= 2) {
                    return callback(null, []);
            Severity: Major
            Found in src/routes/spielplanGenerator/helper.js - About 3 hrs to fix

              Function TurnierImportController has 86 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function TurnierImportController($scope, $uibModalInstance, importedJugend, gewJugend, jugend) {
                      const vm = this;
              
                      _.extend(vm, {
                          jugend: gewJugend,
              Severity: Major
              Found in src/public/components/turnier-import-modal/turnier-import-modal.ui.js - About 3 hrs to fix

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

                module.exports = function (payload, cb) {
                    const properties = helper.configureProperties(payload);
                    const plaetze = properties.plaetze,
                        zeiten = properties.zeiten,
                        gruppen = properties.gruppen,
                Severity: Minor
                Found in src/routes/spielplanGenerator/generateGruppenPhase.js - About 3 hrs 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 JugendPanelController has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function JugendPanelController(auth, gruppe, jugend, GruppeEditierenDialog, spielplan, $state, $scope, BestaetigenDialog, AddZwischengruppeDialog, $rootScope) {
                        const vm = this;
                        vm.loading = true;
                
                        _.extend(vm, {
                Severity: Major
                Found in src/public/components/jugend-panel/jugend-panel.ui.js - About 3 hrs to fix

                  Function SpieleDruckController has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function SpieleDruckController($state, spiele, spiel, $scope, $rootScope, mannschaftslisten) {
                          const vm = this;
                          vm.loading = true;
                  
                          vm.mode = 'all';

                    Function exports has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function (sendgrid, env, url, disableEmails) {
                        const logger = require('winston').loggers.get('apiEmail');
                        const express = require('express');
                        const router = express.Router();
                    
                    
                    Severity: Major
                    Found in src/routes/email.js - About 3 hrs to fix

                      Function sortTeams has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function sortTeams(teams, key, spielModel, gruppe, cb) {
                          if (!key) {
                              key = 'all';
                          }
                      
                      
                      Severity: Major
                      Found in src/models/helper.js - About 3 hrs to fix

                        Function fillSpiele has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function fillSpiele(callback) {
                            logger.verbose('Filling Spiele with Team Infos');
                            const beachEventID = cls.getBeachEventID();
                            const clsSession = cls.getNamespace();
                            return clsSession.run(function () {
                        Severity: Major
                        Found in src/routes/helpers.js - About 3 hrs to fix

                          Function TeamAbonnierenController has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function TeamAbonnierenController($state, $uibModalInstance, gewTeam, email, $rootScope, $timeout) {
                                  const vm = this;
                                  vm.loading = true;
                                  const emptymessage = {
                                      text: '',
                          Severity: Major
                          Found in src/public/components/team-abonnieren-modal/team-abonnieren-modal.js - About 3 hrs to fix

                            Function GruppeEditierenController has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function GruppeEditierenController($state, $uibModalInstance, team, teamPromise, gewGruppe, spielplan, TeamEditierenDialog, BestaetigenDialog, $scope, anmeldung) {
                                    const vm = this;
                                    vm.loading = true;
                            
                                    _.extend(vm, {
                            Severity: Major
                            Found in src/public/components/gruppe-edit-modal/gruppe-edit-modal.js - About 2 hrs to fix

                              Function fill has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              TeamSchema.methods.fill = function(callback) {
                                  const team = this;
                                  const beachEventID = cls.getBeachEventID();
                                  const clsSession = cls.getNamespace();
                                  const results = {
                              Severity: Major
                              Found in src/models/Teams.js - About 2 hrs to fix

                                Function exports has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                module.exports = function (env) {
                                    const logger = require('winston').loggers.get('apiConfig');
                                    const express = require('express');
                                    const version = require('../../package.json').version;
                                    const router = express.Router();
                                Severity: Major
                                Found in src/routes/config.js - About 2 hrs to fix

                                  Function exports has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  module.exports = function (config) {
                                      config.set({
                                  
                                          // base path that will be used to resolve all patterns (eg. files, exclude)
                                          basePath: 'src/public',
                                  Severity: Major
                                  Found in karma.conf.js - About 2 hrs to fix

                                    Function SpieleTabellenController has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function SpieleTabellenController($state, spiel, $rootScope) {
                                            const vm = this;
                                    
                                            _.extend(vm, {
                                                gotoTeam: function (team, $event) {
                                    Severity: Major
                                    Found in src/public/components/spieletabelle/spieletabelle.ui.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language