Showing 351 of 353 total issues
Function exports
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function () {
const logger = require('winston').loggers.get('api');
function send(obj, res) {
let level = 'warn';
if (obj.STATUSCODE < 400) {
Function exports
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (payload, cb) {
const properties = helper.configureProperties(payload);
const plaetze = properties.plaetze,
zeiten = properties.zeiten,
gruppen = properties.gruppen,
Function SlugsContoller
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SlugsContoller(jugenden, gruppen, teams, NgTableParams, $state, $scope, auth, veranstaltungen) {
const vm = this;
vm.loading = true;
const originalTooltipText = 'Klick zum Kopieren';
Function exports
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function () {
const logger = require('winston').loggers.get('apiSpiele');
const express = require('express');
const router = express.Router();
const cls = require('../config/cls.js');
Function SpielController
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SpielController($state, aktivesSpiel, spiel, spielModus, auth, $stateParams, toastr, spielplanEnabled) {
const vm = this;
vm.loading = true;
if (!aktivesSpiel.complex || !aktivesSpiel.complex.hz1 || !aktivesSpiel.complex.hz2 || !aktivesSpiel.complex.hz3) {
Function exports
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (secret) {
const mongoose = require('mongoose');
const crypto = require('crypto');
const jwt = require('jsonwebtoken');
const moment = require('moment');
Similar blocks of code found in 4 locations. Consider refactoring. Open
SpielSchema.methods.setPunkteB = function (punkteB, cb) {
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
const self = this;
return clsSession.run(function () {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 116.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
SpielSchema.methods.setToreA = function (toreA, cb) {
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
const self = this;
return clsSession.run(function () {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 116.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
SpielSchema.methods.setToreB = function (toreB, cb) {
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
const self = this;
return clsSession.run(function () {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 116.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
SpielSchema.methods.setPunkteA = function (punkteA, cb) {
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
const self = this;
return clsSession.run(function () {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 116.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function AddZwischengruppeController
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AddZwischengruppeController($scope, $uibModalInstance, gewJugend, gruppe, $rootScope, $timeout) {
const vm = this;
if($rootScope.spielplanEnabled) {
$timeout(function () {
Function exports
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (sendgrid, env, url, disableMails) {
const logger = require('winston').loggers.get('mailGenerator');
const _ = require('lodash');
const constants = require('./constants.js');
const ejs = require('ejs');
- 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 generateZwischenGruppen
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateZwischenGruppen(gruppen, jugendid, maxTeamsAdvance, callback) {
const gruppenLength = gruppen.length;
const relevantGruppen = [];
if (gruppenLength <= 2) {
return callback(null, []);
Function TurnierImportController
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
function TurnierImportController($scope, $uibModalInstance, importedJugend, gewJugend, jugend) {
const vm = this;
_.extend(vm, {
jugend: gewJugend,
Function exports
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (payload, cb) {
const properties = helper.configureProperties(payload);
const plaetze = properties.plaetze,
zeiten = properties.zeiten,
gruppen = properties.gruppen,
- 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 JugendPanelController
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
function JugendPanelController(auth, gruppe, jugend, GruppeEditierenDialog, spielplan, $state, $scope, BestaetigenDialog, AddZwischengruppeDialog, $rootScope) {
const vm = this;
vm.loading = true;
_.extend(vm, {
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (spiel.toreA > spiel.toreB) {
return clsSession.run(function () {
clsSession.set('beachEventID', beachEventID);
spiel.setPunkte(2, 0, function (err, spiel) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 105.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
} else if (spiel.toreA < spiel.toreB) {
return clsSession.run(function () {
clsSession.set('beachEventID', beachEventID);
spiel.setPunkte(0, 2, function (err, spiel) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 105.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function SpieleDruckController
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SpieleDruckController($state, spiele, spiel, $scope, $rootScope, mannschaftslisten) {
const vm = this;
vm.loading = true;
vm.mode = 'all';
Function exports
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (sendgrid, env, url, disableEmails) {
const logger = require('winston').loggers.get('apiEmail');
const express = require('express');
const router = express.Router();