Dulce-Work-Schedule/2018.1-Dulce_Schedule

View on GitHub

Showing 7 of 25 total issues

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

module.exports = function(options){
  this.add('role:schedule,cmd:createSchedule', async function create (msg,respond) {
    // schedule Entity
    var schedule = this.make(schedule_db);
    // scheduleSettings Entity
Severity: Major
Found in Server/plg_schedule.js - About 1 day to fix

    Function api has 308 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function api(options){
    
    //#############################################################################
      this.add('role:api,path:createSchedule', function(msg, respond){
        // result variable store attribute errors or the success created schedule
    Severity: Major
    Found in Client/api.js - About 1 day to fix

      Function create has 242 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        this.add('role:schedule,cmd:createSchedule', async function create (msg,respond) {
          // schedule Entity
          var schedule = this.make(schedule_db);
          // scheduleSettings Entity
          var scheduleSettings = this.make(schedule_settings_db);
      Severity: Major
      Found in Server/plg_schedule.js - About 1 day to fix

        File plg_schedule.js has 416 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var Promise = require('bluebird');
        
        // BDs names
        var schedule_db = 'schedules'
        var schedule_settings_db = 'scheduleSettings'
        Severity: Minor
        Found in Server/plg_schedule.js - About 6 hrs to fix

          File api.js has 344 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          
          currentWeekNumber = require('current-week-number');
          
          // The RegExp Object above validates MongoBD ObjectIds
          function IsInvalidObjectId(objectIdString){
          Severity: Minor
          Found in Client/api.js - About 4 hrs to fix

            Function format has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              String.prototype.format = function(){
                var replaceable_count = (this.match(/{}/g) || []).length;
                if(arguments.length < replaceable_count){
                  console.log(
                    "Expecting " + replaceable_count + "arguments, " +
            Severity: Minor
            Found in Client/api.js - About 35 mins 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 format has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              String.prototype.format = function(){
                var args = arguments;
                var replaceable_count = (this.match(/{}/g) || []).length;
                if(args.length < replaceable_count){
                  console.log(
            Severity: Minor
            Found in Server/plg_schedule.js - About 35 mins 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

            Severity
            Category
            Status
            Source
            Language