gadael/gadael

View on GitHub

Showing 761 of 761 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

define([], function() {
    'use strict';

    return ['$scope',
        '$location',
Severity: Major
Found in public/js/controllers/account/request/absence-view.js and 2 other locations - About 1 day to fix
public/js/controllers/account/request/time-saving-deposit-view.js on lines 1..49
public/js/controllers/account/request/workperiod-recover-view.js on lines 1..49

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 224.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

define([], function() {
    'use strict';

    return ['$scope',
        '$location',
public/js/controllers/account/request/absence-view.js on lines 1..48
public/js/controllers/account/request/time-saving-deposit-view.js on lines 1..49

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 224.

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

Further Reading

Function exports has 235 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(grunt) {

    'use strict';

    let pkg = require('./package.json');
Severity: Major
Found in Gruntfile.js - About 1 day to fix

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    exports = module.exports = function(services, app) {
    
        var service = new services.get(app);
    
        const gt = app.utility.gettext;
    Severity: Major
    Found in api/services/admin/accountcollections/get.js and 2 other locations - About 1 day to fix
    api/services/admin/accountnwdayscalendars/get.js on lines 3..39
    api/services/admin/accountschedulecalendars/get.js on lines 4..40

    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 223.

    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

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    exports = module.exports = function(services, app) {
    
        var service = new services.get(app);
    
        const gt = app.utility.gettext;
    Severity: Major
    Found in api/services/admin/accountschedulecalendars/get.js and 2 other locations - About 1 day to fix
    api/services/admin/accountcollections/get.js on lines 4..38
    api/services/admin/accountnwdayscalendars/get.js on lines 3..39

    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 223.

    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

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    exports = module.exports = function(services, app) {
    
        var service = new services.get(app);
    
        const gt = app.utility.gettext;
    Severity: Major
    Found in api/services/admin/accountnwdayscalendars/get.js and 2 other locations - About 1 day to fix
    api/services/admin/accountcollections/get.js on lines 4..38
    api/services/admin/accountschedulecalendars/get.js on lines 4..40

    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 223.

    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

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    exports = module.exports = function(services, app) {
    
        var service = new services.delete(app);
    
        const gt = app.utility.gettext;
    Severity: Major
    Found in api/services/admin/rightrenewals/delete.js and 1 other location - About 1 day to fix
    api/services/admin/collections/delete.js on lines 4..39

    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 216.

    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

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    exports = module.exports = function(services, app) {
    
    
        var service = new services.delete(app);
    
    
    Severity: Major
    Found in api/services/admin/collections/delete.js and 1 other location - About 1 day to fix
    api/services/admin/rightrenewals/delete.js on lines 4..40

    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 216.

    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

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    exports = module.exports = function(services, app) {
    
        var service = new services.get(app);
    
        const gt = app.utility.gettext;
    Severity: Major
    Found in api/services/admin/rightrenewals/get.js and 1 other location - About 1 day to fix
    api/services/user/recoverquantities/get.js on lines 5..39

    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 215.

    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

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    exports = module.exports = function(services, app) {
    
    
        var service = new services.get(app);
    
    
    Severity: Major
    Found in api/services/user/recoverquantities/get.js and 1 other location - About 1 day to fix
    api/services/admin/rightrenewals/get.js on lines 4..38

    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 215.

    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

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    exports = module.exports = function(services, app) {
    
        var service = new services.get(app);
    
        const gt = app.utility.gettext;
    Severity: Major
    Found in api/services/admin/invitations/get.js and 1 other location - About 1 day to fix
    api/services/admin/types/get.js on lines 5..39

    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 214.

    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

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    exports = module.exports = function(services, app) {
    
        var service = new services.get(app);
    
        const gt = app.utility.gettext;
    Severity: Major
    Found in api/services/admin/types/get.js and 1 other location - About 1 day to fix
    api/services/admin/invitations/get.js on lines 5..39

    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 214.

    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

    Further Reading

    File Request.js has 539 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    
    /**
     * array map function to get Id from the document or ID
    Severity: Major
    Found in schema/Request.js - About 1 day to fix

      Function exports has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
      Open

      exports = module.exports = function(params) {
      
          let mongoose = params.mongoose;
          let userSchema = new mongoose.Schema({
              password: { type: String, select: false },
      Severity: Minor
      Found in schema/User.js - About 1 day to fix

      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 52 (exceeds 5 allowed). Consider refactoring.
      Open

      exports = module.exports = function(params) {
      
          var mongoose = params.mongoose;
      
      
      
      Severity: Minor
      Found in schema/Right_Renewal.js - About 1 day to fix

      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 202 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports = module.exports = function(params) {
          var mongoose = params.mongoose;
          var absenceElemSchema = new mongoose.Schema({
              quantity: { type: Number, required: true },         // quantity equal to duration of period in the planning (only duration of worked schedule)
              consumedQuantity: { type: Number, required: true }, // quantity removed from vacation right according to Right.consumption
      Severity: Major
      Found in schema/Request_AbsenceElem.js - About 1 day to fix

        Function exports has 201 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports = module.exports = function(params) {
        
            const mongoose = params.mongoose;
        
            const ruleTypes = [
        Severity: Major
        Found in schema/Right_Rule.js - About 1 day to fix

          Function exports has 198 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports = module.exports = function(app, passport) {
          
              let loginservices = app.config.company.loginservices;
              let User = app.db.models.User;
              let gt = app.utility.gettext;
          Severity: Major
          Found in modules/passport.js - About 7 hrs to fix

            Function init has 187 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                return function init(decimalAdjust, gettext) {
            
            
                    /**
                     * Create graph values
            Severity: Major
            Found in public/js/services/beneficiary.js - About 7 hrs to fix

              Function exports has 183 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              exports = module.exports = (app) => {
                  return new OAuthServer({
                      useErrorHandler: true,
                      model: {
                          /**
              Severity: Major
              Found in modules/oauth.js - About 7 hrs to fix
                Severity
                Category
                Status
                Source
                Language