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/admin/account-nwdayscalendars-edit.js and 2 other locations - About 4 days to fix
public/js/controllers/admin/account-collections-edit.js on lines 1..115
public/js/controllers/admin/account-schedulecalendars-edit.js on lines 1..120

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

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',
Severity: Major
Found in public/js/controllers/admin/account-collections-edit.js and 2 other locations - About 4 days to fix
public/js/controllers/admin/account-nwdayscalendars-edit.js on lines 1..120
public/js/controllers/admin/account-schedulecalendars-edit.js on lines 1..120

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

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', 
Severity: Major
Found in public/js/controllers/admin/account-schedulecalendars-edit.js and 2 other locations - About 4 days to fix
public/js/controllers/admin/account-collections-edit.js on lines 1..115
public/js/controllers/admin/account-nwdayscalendars-edit.js on lines 1..120

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

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

exports = module.exports = function(params) {

    var mongoose = params.mongoose;


Severity: Major
Found in schema/Right_Renewal.js - About 3 days to fix

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

    exports = module.exports = function(params) {
        const mongoose = params.mongoose;
        const accountSchema = new mongoose.Schema({
            user: {
              id: { type: mongoose.Schema.Types.ObjectId, ref: 'User', index: true, unique: true },
    Severity: Major
    Found in schema/User_Account.js - About 3 days to fix

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

      exports = module.exports = function(params) {
      
          const dispunits = params.app.utility.dispunits;
          const mongoose = params.mongoose;
      
      
      Severity: Major
      Found in schema/Right.js - About 2 days to fix

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

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

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

          exports = module.exports = function(params) {
          
              const mongoose = params.mongoose;
          
              var requestSchema = new mongoose.Schema({
          Severity: Minor
          Found in schema/Request.js - About 2 days 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 526 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports = module.exports = function(params) {
          
              const mongoose = params.mongoose;
          
              var requestSchema = new mongoose.Schema({
          Severity: Major
          Found in schema/Request.js - About 2 days to fix

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

                if (params._id) {
            
                    AccountCollection.findById(params._id)
                    .then(document => {
            
            
            Severity: Major
            Found in api/services/admin/accountcollections/save.js and 1 other location - About 2 days to fix
            api/services/admin/accountnwdayscalendars/save.js on lines 78..138

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

            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

                if (params.id) {
                    nwdaysCalendar.findById(params.id)
                    .then(document => {
            
                        if (null === document) {
            Severity: Major
            Found in api/services/admin/accountnwdayscalendars/save.js and 1 other location - About 2 days to fix
            api/services/admin/accountcollections/save.js on lines 91..147

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

            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

            define([], function() {
                
                'use strict';
            
                /**
            Severity: Major
            Found in public/js/services/saveAccountScheduleCalendar.js and 1 other location - About 2 days to fix
            public/js/services/saveAccountNWDaysCalendar.js on lines 1..67

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

            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

            define([], function() {
            
                'use strict';
            
                /**
            Severity: Major
            Found in public/js/services/saveAccountNWDaysCalendar.js and 1 other location - About 2 days to fix
            public/js/services/saveAccountScheduleCalendar.js on lines 1..67

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

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

            exports = module.exports = function(params) {
            
                const mongoose = params.mongoose;
            
                var defaultHalfDay = new Date();
            Severity: Major
            Found in schema/Calendar.js - About 2 days to fix

              Similar blocks of code found in 3 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/accountschedulecalendars/delete.js and 2 other locations - About 1 day to fix
              api/services/admin/accountcollections/delete.js on lines 4..64
              api/services/admin/accountnwdayscalendars/delete.js on lines 7..67

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

              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.delete(app);
              
                  const gt = app.utility.gettext;
              Severity: Major
              Found in api/services/admin/accountnwdayscalendars/delete.js and 2 other locations - About 1 day to fix
              api/services/admin/accountcollections/delete.js on lines 4..64
              api/services/admin/accountschedulecalendars/delete.js on lines 6..67

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

              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.delete(app);
              
                  const gt = app.utility.gettext;
              Severity: Major
              Found in api/services/admin/accountcollections/delete.js and 2 other locations - About 1 day to fix
              api/services/admin/accountnwdayscalendars/delete.js on lines 7..67
              api/services/admin/accountschedulecalendars/delete.js on lines 6..67

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

              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 a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
              Open

              exports = module.exports = function(params) {
              
                  const dispunits = params.app.utility.dispunits;
                  const mongoose = params.mongoose;
              
              
              Severity: Minor
              Found in schema/Right.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

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

              define([], function() {
                  'use strict';
              
                  return ['$scope',
                      '$location',
              public/js/controllers/admin/request/time-saving-deposit-view.js on lines 1..48

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

              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

              define([], function() {
                  'use strict';
              
                  return ['$scope',
                      '$location',
              public/js/controllers/admin/request/workperiod-recover-view.js on lines 1..46

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

              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

              Severity
              Category
              Status
              Source
              Language