BerniWittmann/spielplanismaning

View on GitHub

Showing 181 of 353 total issues

Function GruppeEditierenController has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    function GruppeEditierenController($state, $uibModalInstance, team, teamPromise, gewGruppe, spielplan, TeamEditierenDialog, BestaetigenDialog, $scope, anmeldung) {
Severity: Major
Found in src/public/components/gruppe-edit-modal/gruppe-edit-modal.js - About 1 hr to fix

    Function beachEventQueryMiddleware has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    function beachEventQueryMiddleware() {
        const beachEventID = cls.getBeachEventID();
        if (!beachEventID) {
            if (_.includes(JSON.stringify(this.getQuery()), 'veranstaltung')) return;
            if (_.includes(JSON.stringify(this.getQuery()), '_id')) return;
    Severity: Minor
    Found in src/models/helper.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 calculatePresetSpielplanData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function calculatePresetSpielplanData(data) {
        let teams = [];
    
        data.gruppen.forEach(function (gruppe) {
            teams = teams.concat(gruppe.teams);
    Severity: Minor
    Found in src/routes/spielplanGenerator/helper.js - About 1 hr to fix

      Function notifySubscribers has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

        module.exports = function(loglevel) {
            const winston = require('winston');
            
            const createCategory = function(name, label) {
                winston.loggers.add(name, {
        Severity: Minor
        Found in src/config/logging.js - About 1 hr to fix

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

                                                  function sendNextSpielUpdates(cb) {
                                                      logger.verbose('Check if Spiel-Reminder for next Games should be sent');
                                                      return clsSession.run(function () {
                                                          clsSession.set('beachEventID', beachEventID);
                                                          return Spiel.findOne({
          Severity: Minor
          Found in src/routes/spiele.js - About 1 hr to fix

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

                function BugDialog($uibModal) {
                    return {
                        open: open
                    };
            
            
            Severity: Minor
            Found in src/public/components/bug-modal/bug-modal.js - About 1 hr to fix

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

                      function calcZeit(index) {
                          const plaetze = anzahlPlaetze;
                          const dailyStartTime = moment(zeiten.startzeit, 'HH:mm');
                          const dailyEndTime = moment(zeiten.endzeit, 'HH:mm');
                          const spielePerDay = Math.floor(dailyEndTime.diff(dailyStartTime, 'minutes') / (zeiten.spielzeit + zeiten.pausenzeit)) * plaetze;
              Severity: Minor
              Found in src/public/templates/event/spielplan/spielplan.ui.js - About 1 hr to fix

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

                    Query.prototype.exec = function (op, cb) {
                      var deepPopulate = this._deepPopulates
                      if (!deepPopulate) {
                        return _exec.call(this, op, cb)
                      }
                Severity: Minor
                Found in src/config/mongoose-deep-populate.js - About 1 hr to fix

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

                  module.exports = function (app, sendgrid, secret) {
                      const routes = require('./index.js')();
                      const users = require('./users.js')(sendgrid, process.env.NODE_ENV, process.env.URL, process.env.DISABLEEMAIL, secret);
                      const email = require('./email.js')(sendgrid, process.env.NODE_ENV, process.env.URL, process.env.DISABLEEMAIL);
                      const config = require('./config.js')(process.env);
                  Severity: Minor
                  Found in src/routes/routes.js - About 1 hr to fix

                    Function TabellenController has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function TabellenController(jugend, jugenden, jugendTore, gruppen) {
                            const vm = this;
                            vm.loading = true;
                    
                            _.extend(vm, {
                    Severity: Minor
                    Found in src/public/templates/event/tabellen/tabellen.ui.js - About 1 hr to fix

                      Function sendDefaultMail has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          mailGenerator.sendDefaultMail = function (emails, subject, body, cb) {
                              logger.verbose('Sending Plain-Email to %d Subscribers', emails.length);
                              if (emails.length > 0) {
                                  const templatePath = path.join(__dirname, emailTemplatesFolderName, 'default.ejs');
                                  return fs.readFile(templatePath, 'utf-8', function (err, template) {
                      Severity: Minor
                      Found in src/routes/mailGenerator/mailGenerator.js - About 1 hr to fix

                        Function AppController has 9 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            function AppController($q, auth, $state, $timeout, config, $rootScope, veranstaltungen, AVAILABLE_STATES_WITHOUT_EVENT, events) {
                        Severity: Major
                        Found in src/public/app.js - About 1 hr to fix

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

                              function HomeController(spiele, veranstaltungen) {
                                  const vm = this;
                          
                                  vm.loading = true;
                                  const allespiele = _.sortBy(spiele, ['nummer']);
                          Severity: Minor
                          Found in src/public/templates/event/home/home.ui.js - About 1 hr to fix

                            Function getRequiredRouteConfig has 28 lines of code (exceeds 25 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 1 hr to fix

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

                                  function flipcounter() {
                                      return {
                                          restrict: 'A',
                                          link: function (scope, element, attrs) {
                                              const options = {
                              Severity: Minor
                              Found in src/public/templates/event/spiel/spiel.ui.js - About 1 hr to fix

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

                                    function generate(payload, cb) {
                                        logger.verbose('Generator Started');
                                
                                        const beachEventID = cls.getBeachEventID();
                                        const clsSession = cls.getNamespace();
                                Severity: Minor
                                Found in src/routes/spielplanGenerator/spielplanGenerator.js - About 1 hr to fix

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

                                      function NavigationController($state, $rootScope, auth, veranstaltungen) {
                                          const vm = this;
                                  
                                          _.extend(vm, {
                                              isLoggedIn: auth.isLoggedIn,
                                  Severity: Minor
                                  Found in src/public/components/navigation/navigation.ui.js - About 1 hr to fix

                                    Function exports has a Cognitive Complexity of 10 (exceeds 5 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

                                    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 configureProperties has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function configureProperties(payload) {
                                        logger.silly('Running with Payload', payload);
                                        const plaetze = getPlaetze();
                                        logger.verbose('Using %d Plätze', plaetze);
                                        const gruppen = payload.gruppen;
                                    Severity: Minor
                                    Found in src/routes/spielplanGenerator/helper.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language