whitef0x0/tellform

View on GitHub
public/modules/forms/admin/directives/edit-form.client.directive.js

Summary

Maintainability
F
1 wk
Test Coverage

Function controller has 250 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            controller: function($scope){

                /*
                **  Initialize scope with variables
                */
Severity: Major
Found in public/modules/forms/admin/directives/edit-form.client.directive.js - About 1 day to fix

    Function openEditModal has 91 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                    $scope.openEditModal = function(curr_field, isEdit, field_index){
                        $scope.editFieldModal = $uibModal.open({
                            animation: true,
                            templateUrl: 'editFieldModal.html',
                            windowClass: 'edit-modal-window',
    Severity: Major
    Found in public/modules/forms/admin/directives/edit-form.client.directive.js - About 3 hrs to fix

      Function controller has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                              controller:  function($uibModalInstance, $scope) {
                                  $scope.field = curr_field;
                                  $scope.showLogicJump = false;
      
                                  $scope.isEdit = isEdit;
      Severity: Major
      Found in public/modules/forms/admin/directives/edit-form.client.directive.js - About 3 hrs to fix

        File edit-form.client.directive.js has 265 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        
        'use strict';
        
        angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormFields', '$uibModal',
            function ($rootScope, FormFields, $uibModal) {
        Severity: Minor
        Found in public/modules/forms/admin/directives/edit-form.client.directive.js - About 2 hrs to fix

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

                          $scope.openEditEndPageModal = function(){
                              $scope.editEndPageModal = $uibModal.open({
                                  animation: true,
                                  templateUrl: 'editEndPageModal.html',
                                  windowClass: 'edit-modal-window',
          Severity: Minor
          Found in public/modules/forms/admin/directives/edit-form.client.directive.js - About 1 hr to fix

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

                            $scope.openEditStartPageModal = function(){
                                $scope.editStartPageModal = $uibModal.open({
                                    animation: true,
                                    templateUrl: 'editStartPageModal.html',
                                    windowClass: 'edit-modal-window',
            Severity: Minor
            Found in public/modules/forms/admin/directives/edit-form.client.directive.js - About 1 hr to fix

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

                              $scope.addNewField = function(fieldType){
                                  // increment lastAddedID counter
                                  $scope.addField.lastAddedID++;
                                  var fieldTitle = fieldType;
              
              
              Severity: Minor
              Found in public/modules/forms/admin/directives/edit-form.client.directive.js - About 1 hr to fix

                Function controller has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                        controller:  function($uibModalInstance, $scope) {
                
                                            /*
                                             **  startPage Button Methods
                                             */
                Severity: Minor
                Found in public/modules/forms/admin/directives/edit-form.client.directive.js - About 1 hr to fix

                  Function controller has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                          controller:  function($uibModalInstance, $scope) {
                  
                                              /*
                                               **  startPage Button Methods
                                               */
                  Severity: Minor
                  Found in public/modules/forms/admin/directives/edit-form.client.directive.js - About 1 hr to fix

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

                                    $scope.openEditStartPageModal = function(){
                                        $scope.editStartPageModal = $uibModal.open({
                                            animation: true,
                                            templateUrl: 'editStartPageModal.html',
                                            windowClass: 'edit-modal-window',
                    public/modules/forms/admin/directives/edit-form.client.directive.js on lines 209..259

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

                    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

                                    $scope.openEditEndPageModal = function(){
                                        $scope.editEndPageModal = $uibModal.open({
                                            animation: true,
                                            templateUrl: 'editEndPageModal.html',
                                            windowClass: 'edit-modal-window',
                    public/modules/forms/admin/directives/edit-form.client.directive.js on lines 154..204

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

                    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

                                                    if($scope.field.fieldType === 'checkbox' || $scope.field.fieldType === 'dropdown' || $scope.field.fieldType === 'radio'){
                                                        for(var i = 0; i < $scope.field.fieldOptions.length; i++){
                                                            if($scope.field.fieldOptions[i].option_id === option.option_id){
                    
                                                                $scope.field.fieldOptions.splice(i, 1);
                    public/modules/forms/admin/directives/edit-form.client.directive.js on lines 48..52
                    public/modules/forms/admin/directives/edit-form.client.directive.js on lines 73..90

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

                    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

                                                    if($scope.field.fieldType === 'dropdown' || $scope.field.fieldType === 'checkbox' || $scope.field.fieldType === 'radio'){
                                                        return true;
                                                    } else {
                                                        return false;
                                                    }
                    public/modules/forms/admin/directives/edit-form.client.directive.js on lines 73..90
                    public/modules/forms/admin/directives/edit-form.client.directive.js on lines 95..103

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

                    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

                                                    if($scope.field.fieldType === 'checkbox' || $scope.field.fieldType === 'dropdown' || $scope.field.fieldType === 'radio'){
                                                        if(!$scope.field.fieldOptions){
                                                            $scope.field.fieldOptions = [];
                                                        }
                    
                    
                    public/modules/forms/admin/directives/edit-form.client.directive.js on lines 48..52
                    public/modules/forms/admin/directives/edit-form.client.directive.js on lines 95..103

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

                    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

                    There are no issues that match your filters.

                    Category
                    Status