BerniWittmann/spielplanismaning

View on GitHub

Showing 181 of 353 total issues

Function calcSpielDateTimePresets has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function calcSpielDateTimePresets(spielplan, nr, plaetze, delays) {
    const startDatum = moment(spielplan.startdatum, 'DD.MM.YYYY');
    const dailyStartTime = moment(spielplan.startzeit, 'HH:mm');
    const dailyEndTime = moment(spielplan.endzeit, 'HH:mm');
    let spielzeit, pausenzeit;
Severity: Minor
Found in src/routes/helpers.js - About 1 hr to fix

    Function setToreComplex has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    SpielSchema.methods.setToreComplex = function (data, cb) {
        if (!data.complex || !data.complex.hz1 || !data.complex.hz2) {
            return cb(new Error('Keine Halbzeit Daten gefunden'));
        }
    
    
    Severity: Minor
    Found in src/models/Spiele.js - About 1 hr to fix

      Function TeamController has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function TeamController(aktivesTeam, spiele, TeamAbonnierenDialog, email, $state, toastr, gruppe, anmeldung, auth, spielplanEnabled) {
              const vm = this;
              vm.loading = true;
      
              if (!aktivesTeam.name) {
      Severity: Minor
      Found in src/public/templates/event/tgj/teams/team/team.ui.js - About 1 hr to fix

        Function VerwaltungAllgemeinController has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function VerwaltungAllgemeinController(auth) {
                const vm = this;
                vm.loading = true;
        
                //noinspection JSUnusedGlobalSymbols

          Function addSpiele has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function addSpiele(spiele, cb) {
              const beachEventID = cls.getBeachEventID();
              const clsSession = cls.getNamespace();
              return clsSession.run(function () {
                  clsSession.set('beachEventID', beachEventID);
          Severity: Minor
          Found in src/routes/spielImporter/importer.js - About 1 hr to fix

            Function reloadAnmeldeObjects has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function reloadAnmeldeObjects(cb) {
                const beachEventID = cls.getBeachEventID();
                const clsSession = cls.getNamespace();
                return clsSession.run(function () {
                    clsSession.set('beachEventID', beachEventID);
            Severity: Minor
            Found in src/routes/helpers.js - About 1 hr to fix

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

              module.exports = function (app) {
                  const mongoose = require('mongoose');
                  const logger = require('winston').loggers.get('middlewareEvent');
                  const Veranstaltung = mongoose.model('Veranstaltung');
                  const constants = require('../../config/constants.js');
              Severity: Minor
              Found in src/routes/middleware/beachEvent.js - About 1 hr to fix

                Function AnsprechpartnerSingleController has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function AnsprechpartnerSingleController($scope, ansprechpartner, toastr) {
                        const vm = this;
                
                        _.extend(vm, {
                            kontakt: $scope.spiAnsprechpartnerSingle,

                  Function generateNew has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      spielplanGenerator.generateNew = function (cb) {
                          logger.verbose('Generate a complete new Spielplan');
                          const data = {};
                          const beachEventID = cls.getBeachEventID();
                          const clsSession = cls.getNamespace();
                  Severity: Minor
                  Found in src/routes/spielplanGenerator/spielplanGenerator.js - About 1 hr to fix

                    Function createGruppeWithTeams has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function createGruppeWithTeams(jugendid, data, cb) {
                        const beachEventID = cls.getBeachEventID();
                        const clsSession = cls.getNamespace();
                        return clsSession.run(function () {
                            clsSession.set('beachEventID', beachEventID);
                    Severity: Minor
                    Found in src/routes/helpers.js - About 1 hr to fix

                      Function createParams has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function createParams(model, docs, paths, options, lean) {
                          var rewrite = options.rewrite
                            , whitelist = options.whitelist
                            , populate = options.populate
                      
                      
                      Severity: Minor
                      Found in src/config/mongoose-deep-populate.js - About 1 hr to fix

                        Function createBlankJugend has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function createBlankJugend(req, res) {
                                const beachEventID = cls.getBeachEventID();
                                const clsSession = cls.getNamespace();
                                return clsSession.run(function () {
                                    clsSession.set('beachEventID', beachEventID);
                        Severity: Minor
                        Found in src/routes/jugenden.js - About 1 hr to fix

                          Function sendSpielReminder has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              mailGenerator.sendSpielReminder = function (team, spiel, emails, cb) {
                                  logger.verbose('Sending Spiel-Reminder to %d Subscribers', emails.length);
                                  const beachEventID = cls.getBeachEventID();
                                  if (emails.length > 0) {
                                      const templatePath = path.join(__dirname, emailTemplatesFolderName, 'spielReminder.ejs');
                          Severity: Minor
                          Found in src/routes/mailGenerator/mailGenerator.js - About 1 hr to fix

                            Function generateZwischenGruppenHelper has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function generateZwischenGruppenHelper(gruppen, maxTeamsAdvance, zeiten, cb) {
                                let relevantGruppen = [];
                                const beachEventID = cls.getBeachEventID();
                                const clsSession = cls.getNamespace();
                            
                            
                            Severity: Minor
                            Found in src/routes/spielplanGenerator/helper.js - About 1 hr to fix

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

                              module.exports = function (payload, cb) {
                                  logger.verbose('Generate End-Runde');
                                  const gruppenSpiele = payload.spiele;
                                  let newSpiele = [];
                                  const gruppenByJugend = helper.getGruppenWithSameJugend(payload.gruppen);
                              Severity: Minor
                              Found in src/routes/spielplanGenerator/generateEndRunde.js - About 1 hr to fix

                                Function checkSpielOrderChangeAllowed has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function checkSpielOrderChangeAllowed(spiele) {
                                    logger.verbose('Check Spiel Order Allowed');
                                    const plaetze = parseInt(process.env.PLAETZE, 10);
                                    logger.verbose('Calculated %d Plätze', plaetze);
                                    let teamsParallel = [];
                                Severity: Minor
                                Found in src/routes/helpers.js - About 1 hr 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 BugMailController has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function BugMailController($uibModalInstance, $timeout, email, version, env, username, role) {
                                        const vm = this;
                                
                                        _.extend(vm, {
                                            sent: false,
                                Severity: Minor
                                Found in src/public/components/bug-modal/bug-modal.js - About 1 hr to fix

                                  Function VerwaltungVeranstaltungenController has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function VerwaltungVeranstaltungenController(alleVeranstaltungen, veranstaltungen, VeranstaltungEditierenDialog, BestaetigenDialog) {
                                          const vm = this;
                                          vm.loading = true;
                                  
                                          _.extend(vm, {

                                    Function teamCalcErgebnisse has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function teamCalcErgebnisse(team, gruppe, cb) {
                                        const query = {
                                            beendet: true
                                        };
                                        if (gruppe) {
                                    Severity: Minor
                                    Found in src/routes/helpers.js - About 1 hr to fix

                                      Function AppController has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          function AppController($q, auth, $state, $timeout, config, $rootScope, veranstaltungen, AVAILABLE_STATES_WITHOUT_EVENT, events) {
                                              const vm = this;
                                              vm.runBefore = false;
                                      
                                              $rootScope.$on('$stateChangeStart', function (event, toState, toStateParams) {
                                      Severity: Minor
                                      Found in src/public/app.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language