Showing 181 of 353 total issues
Function GruppeEditierenController
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function GruppeEditierenController($state, $uibModalInstance, team, teamPromise, gewGruppe, spielplan, TeamEditierenDialog, BestaetigenDialog, $scope, anmeldung) {
Function beachEventQueryMiddleware
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
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;
- Read upRead up
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
Open
function calculatePresetSpielplanData(data) {
let teams = [];
data.gruppen.forEach(function (gruppe) {
teams = teams.concat(gruppe.teams);
Function notifySubscribers
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function notifySubscribers(spiel, fn, callback) {
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
return clsSession.run(function () {
clsSession.set('beachEventID', beachEventID);
Function exports
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(loglevel) {
const winston = require('winston');
const createCategory = function(name, label) {
winston.loggers.add(name, {
Function sendNextSpielUpdates
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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({
Function BugDialog
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function BugDialog($uibModal) {
return {
open: open
};
Function calcZeit
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function exec
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Query.prototype.exec = function (op, cb) {
var deepPopulate = this._deepPopulates
if (!deepPopulate) {
return _exec.call(this, op, cb)
}
Function exports
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Function TabellenController
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function TabellenController(jugend, jugenden, jugendTore, gruppen) {
const vm = this;
vm.loading = true;
_.extend(vm, {
Function sendDefaultMail
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Function AppController
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function AppController($q, auth, $state, $timeout, config, $rootScope, veranstaltungen, AVAILABLE_STATES_WITHOUT_EVENT, events) {
Function HomeController
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function HomeController(spiele, veranstaltungen) {
const vm = this;
vm.loading = true;
const allespiele = _.sortBy(spiele, ['nummer']);
Function getRequiredRouteConfig
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getRequiredRouteConfig(routes, path, method, configKey) {
logger.silly('Getting Route Config');
path = removeLastSlashFromPath(path);
let route = routes[path];
Function flipcounter
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function flipcounter() {
return {
restrict: 'A',
link: function (scope, element, attrs) {
const options = {
Function generate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generate(payload, cb) {
logger.verbose('Generator Started');
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
Function NavigationController
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function NavigationController($state, $rootScope, auth, veranstaltungen) {
const vm = this;
_.extend(vm, {
isLoggedIn: auth.isLoggedIn,
Function exports
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
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');
- Read upRead up
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
Open
function configureProperties(payload) {
logger.silly('Running with Payload', payload);
const plaetze = getPlaetze();
logger.verbose('Using %d Plätze', plaetze);
const gruppen = payload.gruppen;