martinmicunda/employee-scheduling-ui

View on GitHub

Showing 20 of 458 total issues

File employee-account-details.spec.js has 439 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @author    Martin Micunda {@link http://martinmicunda.com}
 * @copyright Copyright (c) 2015, Martin Micunda
 * @license   GPL-3.0
 */

    File account-details.spec.js has 375 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * @author    Martin Micunda {@link http://martinmicunda.com}
     * @copyright Copyright (c) 2015, Martin Micunda
     * @license   GPL-3.0
     */

      File modal-document.spec.js has 368 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * @author    Martin Micunda {@link http://martinmicunda.com}
       * @copyright Copyright (c) 2015, Martin Micunda
       * @license   GPL-3.0
       */
      Severity: Minor
      Found in src/app/components/modal-document/modal-document.spec.js - About 4 hrs to fix

        File modal-partner.spec.js has 361 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * @author    Martin Micunda {@link http://martinmicunda.com}
         * @copyright Copyright (c) 2015, Martin Micunda
         * @license   GPL-3.0
         */
        Severity: Minor
        Found in src/app/components/modal-partner/modal-partner.spec.js - About 4 hrs to fix

          File modal-location.spec.js has 342 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * @author    Martin Micunda {@link http://martinmicunda.com}
           * @copyright Copyright (c) 2015, Martin Micunda
           * @license   GPL-3.0
           */
          Severity: Minor
          Found in src/app/components/modal-location/modal-location.spec.js - About 4 hrs to fix

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

                init($httpBackend, localStorageService, route, mockData, mockListData, errorField){
                    const patternBase = new RegExp(`\/${route}`);
                    const patternGet = new RegExp(`\/${route}\/[a-z]*`);
                    const patternId = new RegExp(`\/${route}\/(\\d+|[a-z]*)`);
                    const key = route.slice(0, -1);
            Severity: Major
            Found in src/app/core/resources/abstract-resource-mock.js - About 2 hrs to fix

              Function runFactory has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @Run()
                  @Inject('$httpBackend', '$window')
                  //end-non-standard
                  static runFactory($httpBackend, $window){
                      $httpBackend.whenPOST(/\/login/)
              Severity: Major
              Found in src/app/core/resources/authentication/authentication.mock.js - About 2 hrs to fix

                Function getCalendarConfig has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    getCalendarConfig(scope, calendarView) {
                        let resourcesLength = 1;
                        const height = Math.max(600, this.$window.innerHeight - 220);
                
                        const config = {
                Severity: Major
                Found in src/app/core/services/availability.js - About 2 hrs to fix

                  File password.spec.js has 262 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /**
                   * @author    Martin Micunda {@link http://martinmicunda.com}
                   * @copyright Copyright (c) 2015, Martin Micunda
                   * @license   GPL-3.0
                   */
                  Severity: Minor
                  Found in src/app/routes/layout-app/account/password/password.spec.js - About 2 hrs to fix

                    File header.spec.js has 261 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /**
                     * @author    Martin Micunda {@link http://martinmicunda.com}
                     * @copyright Copyright (c) 2015, Martin Micunda
                     * @license   GPL-3.0
                     */
                    Severity: Minor
                    Found in src/app/components/header/header.spec.js - About 2 hrs to fix

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

                      module.exports = function (config) {
                          config.set({
                              frameworks: ['jspm', 'jasmine'],
                      
                              files: [
                      Severity: Minor
                      Found in karma.conf.js - About 1 hr to fix

                        Function constructor has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            constructor($timeout, $compile, $state, $modal, $window, localStorageService, AvailabilityModel, uiCalendarConfig, ModalService, AuthenticationService, FormService, EmployeeResource) {
                                const date = new Date();
                                const m = date.getMonth();
                                const y = date.getFullYear();
                                this.$compile = $compile;
                        Severity: Minor
                        Found in src/app/core/services/availability.js - About 1 hr to fix

                          Function runFactory has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              @Run()
                              @Inject('$httpBackend', 'localStorageService')
                              //end-non-standard
                              runFactory($httpBackend, localStorageService){
                                  const key = 'availability';
                          Severity: Minor
                          Found in src/app/core/resources/availability/availability.mock.js - About 1 hr to fix

                            Function runFactory has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @Run()
                                @Inject('$rootScope', '$state', '$log', 'AuthenticationService')
                                //end-non-standard
                                static runFactory($rootScope, $state, $log, AuthenticationService){
                                    $rootScope.currentUser = AuthenticationService.getCurrentUser();
                            Severity: Minor
                            Found in src/app/core/config/config.js - About 1 hr to fix

                              Function getCalendarConfig has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  getCalendarConfig(scope, calendarView) {
                                      let resourcesLength = 1;
                                      const height = Math.max(600, this.$window.innerHeight - 220);
                              
                                      const config = {
                              Severity: Minor
                              Found in src/app/core/services/availability.js - About 1 hr 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 onFailure has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  onFailure(self, response) {
                                      self.result = 'error';
                                      self.hasError = true;
                                      if(response.status === 400) {
                                          self.errorMessage = response.data.message;
                              Severity: Minor
                              Found in src/app/core/services/form.js - About 55 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 request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  request(config) {
                                      // Filter out requests for .html templates, etc
                                      if (self.shouldPrependApiUrl(config)) {
                                          config.url = self.apiUrl + config.url;
                              
                              
                              Severity: Minor
                              Found in src/app/core/interceptors/http-api-url.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

                              Avoid too many return statements within this function.
                              Open

                                              return [200];
                              Severity: Major
                              Found in src/app/core/resources/authentication/authentication.mock.js - About 30 mins to fix

                                Function Component has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function Component(component) {
                                    return function decorator(target) {
                                        component = component ? component : {};
                                        if (!component.selector) {
                                            throw new Error('@Component() must contains selector property!');
                                Severity: Minor
                                Found in src/app/ng-decorators.js - About 25 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 createOrReplaceAvailabilities has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    createOrReplaceAvailabilities(dateRangeLength, availability) {
                                        let i = 0, id, idx, date;
                                        const availabilities = this.AvailabilityModel.getCollection();
                                        const startDate = moment(availability.start); // make `availability.start` object immutable for add function
                                
                                
                                Severity: Minor
                                Found in src/app/core/services/availability.js - About 25 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