Showing 181 of 353 total issues
Function addSpiele
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function addSpiele(spiele, cb) {
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
return clsSession.run(function () {
clsSession.set('beachEventID', beachEventID);
Function Logger
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Logger(LOG_PREFIX, LOG_MAX_STRING_LENGTH) {
let LOGGING_ENABLED = false;
return {
log: function (text) {
Function setToreComplex
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SpielSchema.methods.setToreComplex = function (data, cb) {
if (!data.complex || !data.complex.hz1 || !data.complex.hz2) {
return cb(new Error('Keine Halbzeit Daten gefunden'));
}
Function VerwaltungAllgemeinController
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function VerwaltungAllgemeinController(auth) {
const vm = this;
vm.loading = true;
//noinspection JSUnusedGlobalSymbols
Function calcSpielDateTimePresets
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function reloadAnmeldeObjects
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function reloadAnmeldeObjects(cb) {
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
return clsSession.run(function () {
clsSession.set('beachEventID', beachEventID);
Function AnsprechpartnerSingleController
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
spielplanGenerator.generateNew = function (cb) {
logger.verbose('Generate a complete new Spielplan');
const data = {};
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
Function exports
has 42 lines of code (exceeds 25 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');
Function createBlankJugend
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createBlankJugend(req, res) {
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
return clsSession.run(function () {
clsSession.set('beachEventID', beachEventID);
Function createGruppeWithTeams
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createGruppeWithTeams(jugendid, data, cb) {
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
return clsSession.run(function () {
clsSession.set('beachEventID', beachEventID);
Function createParams
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createParams(model, docs, paths, options, lean) {
var rewrite = options.rewrite
, whitelist = options.whitelist
, populate = options.populate
Function sendSpielReminder
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
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');
Function exports
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (payload, cb) {
logger.verbose('Generate End-Runde');
const gruppenSpiele = payload.spiele;
let newSpiele = [];
const gruppenByJugend = helper.getGruppenWithSameJugend(payload.gruppen);
Function generateZwischenGruppenHelper
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generateZwischenGruppenHelper(gruppen, maxTeamsAdvance, zeiten, cb) {
let relevantGruppen = [];
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
Function checkSpielOrderChangeAllowed
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
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 = [];
- 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 VerwaltungVeranstaltungenController
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function VerwaltungVeranstaltungenController(alleVeranstaltungen, veranstaltungen, VeranstaltungEditierenDialog, BestaetigenDialog) {
const vm = this;
vm.loading = true;
_.extend(vm, {
Function BugMailController
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function BugMailController($uibModalInstance, $timeout, email, version, env, username, role) {
const vm = this;
_.extend(vm, {
sent: false,
Function teamCalcErgebnisse
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function teamCalcErgebnisse(team, gruppe, cb) {
const query = {
beendet: true
};
if (gruppe) {
Function AppController
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {