gadael/gadael

View on GitHub
public/js/services/absence-edit.js

Summary

Maintainability
D
2 days
Test Coverage

File absence-edit.js has 448 lines of code (exceeds 250 allowed). Consider refactoring.
Open

define(['angular', 'services/request-edit'], function(angular, loadRequestEdit) {
    'use strict';

    return function(gettextCatalog) {
        var RequestEdit = loadRequestEdit(gettextCatalog);
Severity: Minor
Found in public/js/services/absence-edit.js - About 6 hrs to fix

    Function createDistribution has 113 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function createDistribution(renewals, periods, accountRights, matchQuantity) {
    
                var totalSeconds = 0;
                var totalDays = 0;
    
    
    Severity: Major
    Found in public/js/services/absence-edit.js - About 4 hrs to fix

      Function getNextButtonJob has 94 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function getNextButtonJob($scope, user, accountRights) {
      
                  return function() {
                      // hide the period selection
                      $scope.periodSelection = false;
      Severity: Major
      Found in public/js/services/absence-edit.js - About 3 hrs to fix

        Function distributionWatch has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function distributionWatch(distribution, $scope) {
                    /**
                     * Browse the rights appliquable for distribution
                     * @param {function} action     function to call on each rights
                     *
        Severity: Major
        Found in public/js/services/absence-edit.js - About 2 hrs to fix

          Function setConsumedQuantities has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function setConsumedQuantities($scope, consumption, user) {
          
                      var renewals = $scope.distribution.renewal;
                      var periods = $scope.selection.periods;
                      var distribution;
          Severity: Minor
          Found in public/js/services/absence-edit.js - About 1 hr to fix

            Avoid too many return statements within this function.
            Open

                                return 'has-warning';
            Severity: Major
            Found in public/js/services/absence-edit.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return 'has-success';
              Severity: Major
              Found in public/js/services/absence-edit.js - About 30 mins to fix

                There are no issues that match your filters.

                Category
                Status