Showing 181 of 353 total issues
Function getTeamDisplay
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
spiel.getTeamDisplay = function (game, teamStr) {
if (game['team' + teamStr]) {
if (game['team' + teamStr].isPlaceholder && !game['team' + teamStr].name) {
const t = teams.find(function (single) {
return single._id.toString() === game['team' + teamStr]._id.toString();
Function resetPunkte
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SpielSchema.methods.resetPunkte = function (cb) {
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
const self = this;
return clsSession.run(function () {
Function SpielController
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function SpielController($state, aktivesSpiel, spiel, spielModus, auth, $stateParams, toastr, spielplanEnabled) {
Function SlugsContoller
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function SlugsContoller(jugenden, gruppen, teams, NgTableParams, $state, $scope, auth, veranstaltungen) {
Function getTeam
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function getTeam(gruppe, gegner, geradeSpielendeTeams, lastPlayingTeams, spiele, name, i) {
Function prepareField
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function prepareField(key, storeKey, store, spiel, index, errMessage, cb) {
Function VerwaltungSpielplanController
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function VerwaltungSpielplanController(spielplan, zeiten, $scope, toastr, spiele, spiel, spielplanEnabled) {
Function SpielplanSingleSpielController
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function SpielplanSingleSpielController($scope, $state, auth, spiel, BestaetigenDialog, $timeout, $rootScope) {
Function BugMailController
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function BugMailController($uibModalInstance, $timeout, email, version, env, username, role) {
Function checkLockdown
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function checkLockdown($q, auth, $state, $timeout, config, toState, $rootScope) {
Function execute
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function execute(model, docs, paths, options, defaultOptions, lean, cb) {
Function SpieleDruckController
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function SpieleDruckController($state, spiele, spiel, $scope, $rootScope, mannschaftslisten) {
Function exports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function (app, secret) {
const logger = require('winston').loggers.get('middlewareAuthorization');
const messages = require('./../messages/messages.js')();
const jwt = require('jsonwebtoken');
const _ = require('lodash');
- 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 EmailAbonnementsContoller
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function EmailAbonnementsContoller(email, BestaetigenDialog, NgTableParams, $state, subscribers, spielplanEnabled) {
Function TeamAbonnierenController
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function TeamAbonnierenController($state, $uibModalInstance, gewTeam, email, $rootScope, $timeout) {
Function createSpielFromSpiel
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function createSpielFromSpiel(spielA, spielB, rankA, rankB, jugendid, label) {
Function isValidToken
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function isValidToken($stateParams, $q, $state, toastr, $timeout, auth) {
Function getRequiredRouteConfig
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
function getRequiredRouteConfig(routes, path, method, configKey) {
logger.silly('Getting Route Config');
path = removeLastSlashFromPath(path);
let route = routes[path];
- 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 AddZwischengruppeController
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function AddZwischengruppeController($scope, $uibModalInstance, gewJugend, gruppe, $rootScope, $timeout) {
Consider simplifying this complex logical expression. Open
Open
if (foundSpiel.teamA && foundSpiel.teamA._id &&
foundSpiel.teamB && foundSpiel.teamB._id &&
foundSpiel.gewinner && foundSpiel.gewinner._id) {
if (foundSpiel.teamA._id.toString() === foundSpiel.gewinner._id.toString()) {
calculatedTeams[letter] = foundSpiel.teamB;