Showing 364 of 761 total issues
Function createController
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createController() {
ctrlFactory.create.call(this, '/rest/anonymous/createfirstadmin');
var controller = this;
this.controllerAction = function() {
Function addAdjustment
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.addAdjustment = function addAdjustment(renewal) {
var modalscope = $scope.$new();
modalscope.renewal = renewal;
Function getCollections
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getCollections(accountCollections, refDate) {
var r = {
prev: null,
current: null,
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(service, from, to, types) {
Function create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
api.create = function(app, parent, name, operator) {
const Charlatan = require('charlatan');
const DepartmentModel = app.db.models.Department;
Function createRight
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
api.createRight = function(app, props) {
let rightModel = app.db.models.Right;
let right = new rightModel();
if (undefined !== props) {
Function removeOrUpdate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var removeOrUpdate = function(userDocument, checkedRole, model, updateCallback, noRoleCallback) {
var promise = model.find({ 'user.id': userDocument._id }).exec();
promise.then(function(roles) {
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(services, app) {
const dispunits = app.utility.dispunits;
var service = new services.list(app);
Consider simplifying this complex logical expression. Open
if ($scope.user.$promise) {
$scope.user.$promise.then(function() {
$scope.user.isAccount = ($scope.user.roles && $scope.user.roles.account !== undefined && $scope.user.roles.account !== null);
$scope.user.isAdmin = ($scope.user.roles && $scope.user.roles.admin !== undefined && $scope.user.roles.admin !== null);
Consider simplifying this complex logical expression. Open
if ($scope.user.$promise) {
$scope.user.$promise.then(function() {
$scope.user.isAccount = ($scope.user.roles && $scope.user.roles.account !== undefined && $scope.user.roles.account !== null);
$scope.user.isAdmin = ($scope.user.roles && $scope.user.roles.admin !== undefined && $scope.user.roles.admin !== null);
Function createOnRenewal
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function createOnRenewal(app, rightDocument, renewal, user, dtstart, dtend, nbdays, timeCreated) {
Function exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(services, app) {
var service = new services.list(app);
/**
- 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 exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(services, app) {
var service = new services.delete(app);
const gt = app.utility.gettext;
- 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 exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(services, app) {
var service = new services.list(app);
- 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 exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(services, app)
{
var service = new services.list(app);
- 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 exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(services, app) {
var service = new services.get(app);
const gt = app.utility.gettext;
- 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 getHighestPort
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getHighestPort: function getHighestPort(app, callback) {
this.getCompanies(app).then(companies => {
var max = 0;
for (let dbName in companies) {
- 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
Avoid deeply nested control flow statements. Open
if ($scope.accountRights[i].to) {
$scope.accountRights[i].to = new Date($scope.accountRights[i].to);
}
Avoid deeply nested control flow statements. Open
if ($scope.accountScheduleCalendars[i].to) {
$scope.accountScheduleCalendars[i].to = new Date($scope.accountScheduleCalendars[i].to);
}
Avoid deeply nested control flow statements. Open
if ($scope.accountRights[i].from) {
$scope.accountRights[i].from = new Date($scope.accountRights[i].from);
}