Showing 351 of 353 total issues
Function populate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function populate(opts, level, cb) {
var docs = opts.docs
, paths = opts.paths
, lvlPaths = paths.filter(function (path) { return (path.split('.').length - 1) === level })
, remained = lvlPaths.length
Function authenticate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const authenticate = function (req, res, next) {
const requiredRoles = helpers.getRequiredRouteConfig(routes, req.path, req.method, 'AUTH');
logger.silly('Required Roles: ', requiredRoles);
Function getEntity
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getEntity(model, population, notFoundMessage, res, req) {
const queryData = getEntityQuery(model, req);
const query = queryData.query;
const searchById = queryData.searchById;
const beachEventID = cls.getBeachEventID();
Function VerwaltungSpielplanController
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function VerwaltungSpielplanController(spielplan, zeiten, $scope, toastr, spiele, spiel, spielplanEnabled) {
const vm = this;
vm.loading = true;
_.extend(vm, {
Function VerwaltungTeamsController
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function VerwaltungTeamsController($scope, auth, jugend, spielplan, $timeout, jugenden, teams, JUGEND_FARBEN, team, turniere, TurnierImportDialog) {
const vm = this;
vm.loading = true;
_.extend(vm, {
Function fill
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function fill(entity, cb) {
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
return clsSession.run(function () {
clsSession.set('beachEventID', beachEventID);
Similar blocks of code found in 2 locations. Consider refactoring. Open
return clsSession.run(function () {
clsSession.set('beachEventID', beachEventID);
return helpers.removeEntityBy(Jugend, '_id', req.query.id, function (err) {
return handler.handleErrorAndDeleted(err, res);
});
- 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 68.
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
return clsSession.run(function () {
clsSession.set('beachEventID', beachEventID);
return helpers.removeEntityBy(Spiel, '_id', req.query.id, function (err) {
return handler.handleErrorAndDeleted(err, res);
});
- 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 68.
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 VerwaltungTeamsController
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
function VerwaltungTeamsController($scope, auth, jugend, spielplan, $timeout, jugenden, teams, JUGEND_FARBEN, team, turniere, TurnierImportDialog) {
Function passwordForgotMail
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
mailGenerator.passwordForgotMail = function (user, cb) {
logger.verbose('Sending Password-Forgot-Email');
if (user) {
const templatePath = path.join(__dirname, emailTemplatesFolderName, 'passwordForgot.ejs');
return fs.readFile(templatePath, 'utf-8', function (err, template) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
veranstaltungen.create = function (data) {
return routes.requestPOST(routes.urls.veranstaltungen.base(), data).then(function (res) {
cacheAlleEvents();
return res;
});
- 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 67.
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
veranstaltungen.delete = function (id) {
return routes.requestDELETE(routes.urls.veranstaltungen.base(), id).then(function (res) {
cacheAlleEvents();
return res;
});
- 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 67.
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 setPunkte
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
SpielSchema.methods.setPunkte = function (punkteA, punkteB, cb) {
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
const self = this;
return clsSession.run(function () {
Function checkSpielChangeable
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkSpielChangeable(spielid, cb) {
const beachEventID = cls.getBeachEventID();
const clsSession = cls.getNamespace();
return clsSession.run(function () {
clsSession.set('beachEventID', beachEventID);
Function bugReportMail
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
mailGenerator.bugReportMail = function (data, cb) {
logger.verbose('Sending Bug-Report');
const beachEventID = cls.getBeachEventID();
const templatePath = path.join(__dirname, emailTemplatesFolderName, 'bugReport.ejs');
return fs.readFile(templatePath, 'utf-8', function (err, template) {
Function handleBadRequest
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleBadRequest = function (req, res, next) {
const requiredKeys = helpers.getRequiredRouteConfig(routes, req.path, req.method, 'PARAMS');
if (requiredKeys) {
logger.silly('Required Keys', requiredKeys);
Function SpielplanController
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
function SpielplanController($state, $scope, spiele, spiel, auth, toastr, anzahlPlaetze, spielModus, zeiten, spielplanEnabled) {
Function JugendPanelController
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
function JugendPanelController(auth, gruppe, jugend, GruppeEditierenDialog, spielplan, $state, $scope, BestaetigenDialog, AddZwischengruppeDialog, $rootScope) {
Function TeamController
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
function TeamController(aktivesTeam, spiele, TeamAbonnierenDialog, email, $state, toastr, gruppe, anmeldung, auth, spielplanEnabled) {
Function GruppeEditierenController
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
function GruppeEditierenController($state, $uibModalInstance, team, teamPromise, gewGruppe, spielplan, TeamEditierenDialog, BestaetigenDialog, $scope, anmeldung) {