whitef0x0/tellform

View on GitHub

Showing 608 of 608 total issues

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

var sampleFormFields = [
    {'fieldType':'textfield', 'title':'What\'s your first name', 'fieldValue': ''},
    {'fieldType':'textfield', 'title':'And your last name',  'fieldValue': ''},
    {'fieldType':'radio',     'title':'And your sex',  'fieldOptions': [{ 'option_id': 0, 'option_title': 'Male', 'option_value': 'M' }, { 'option_id': 1, 'option_title': 'Female', 'option_value': 'F' }], 'fieldValue': ''},
    {'fieldType':'date',         'title':'When were you born?',  'fieldValue': ''},
Severity: Major
Found in app/tests/form_submission.model.test.js and 1 other location - About 4 hrs to fix
app/tests/form_submission.model.test.js on lines 101..107

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

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

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

        var newFakeModal = function(){
            var modal = {
                opened: true,
                close: function( item ) {
                    //The user clicked OK on the modal dialog, call the stored confirm callback with the selected item
public/modules/forms/tests/unit/directives/edit-form.client.directive.test.js on lines 83..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 118.

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

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

        var newFakeModal = function(){
            var modal = {
                opened: true,
                close: function( item ) {
                    //The user clicked OK on the modal dialog, call the stored confirm callback with the selected item
public/modules/forms/tests/unit/controllers/admin-form.client.controller.test.js on lines 147..167

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

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

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

'use strict';

//FIXME: Should find an appropriate place for this
//Setting up jsep
jsep.addBinaryOp('contains', 10);

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

    exports.forgot = function(req, res) {
        async.waterfall([
            // Generate random token
            function(done) {
                crypto.randomBytes(20, function(err, buffer) {
    Severity: Major
    Found in app/controllers/users/users.password.server.controller.js - About 3 hrs 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

        File gruntfile.js has 315 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        'use strict';
        
        var bowerArray = ['public/lib/angular/angular.min.js',
            'public/lib/angular-scroll/angular-scroll.min.js',
            'public/lib/angular-ui-select/dist/select.min.js',
        Severity: Minor
        Found in gruntfile.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

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

                        var myForm1 = {
                            title: 'First Form',
                            language: 'en',
                            admin: user.id,
                            form_fields: [
            Severity: Major
            Found in app/tests/form.server.routes.test.js and 1 other location - About 3 hrs to fix
            app/tests/form.server.routes.test.js on lines 325..335

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

            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

                        var myForm2 = {
                            title: 'Second Form',
                            language: 'en',
                            admin: user.id,
                            form_fields: [
            Severity: Major
            Found in app/tests/form.server.routes.test.js and 1 other location - About 3 hrs to fix
            app/tests/form.server.routes.test.js on lines 313..323

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

            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

                it('should create custom attributes', function (done) {
                  bar.save(function (err, doc) {
                    assert.strictEqual(err, null)
                    assert.strictEqual(util.isDate(doc.oh), true)
                    assert.strictEqual(util.isDate(doc.hai), true)
            Severity: Major
            Found in app/tests/libs/timestamp.server.plugin.test.js and 1 other location - About 3 hrs to fix
            app/tests/libs/timestamp.server.plugin.test.js on lines 29..36

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

            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

                it('should create the default attributes', function (done) {
                  bar.save(function (err, doc) {
                    assert.strictEqual(err, null)
                    assert.strictEqual(util.isDate(doc.created), true)
                    assert.strictEqual(util.isDate(doc.modified), true)
            Severity: Major
            Found in app/tests/libs/timestamp.server.plugin.test.js and 1 other location - About 3 hrs to fix
            app/tests/libs/timestamp.server.plugin.test.js on lines 61..68

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

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

            function BaseFieldSchema(){
                Schema.apply(this, arguments);
            
                this.add({
                    globalId: {
            Severity: Major
            Found in app/models/form_field.server.model.js - About 3 hrs to fix

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

                      it('should emit "ngRepeat Finished" and "ngRepeat Started" events on ng-repeat when attr is not set to string', inject(function($compile, $rootScope) {
                          scope.myfields = FormFields.types;
              
                          $compile('<div><div ng-repeat="item in myfields" on-finish-render>{{item.name}}</div></div>')(scope);
                          scope.$digest();
              public/modules/forms/tests/unit/directives/on-finish-render.client.directive.test.js on lines 78..87

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

              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

                      it('should emit Custom "Finished" and "Started" events on ng-repeat', inject(function($compile, $rootScope) {
                          scope.myfields = FormFields.types;
              
                          $compile('<div><div ng-repeat="item in myfields" on-finish-render="editFormFields">{{item.name}}</div></div>')(scope);
                          scope.$digest();
              public/modules/forms/tests/unit/directives/on-finish-render.client.directive.test.js on lines 89..98

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

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

                      $scope.update = $rootScope.update = function(updateImmediately, data, shouldDiff, refreshAfterUpdate, cb){
                          var continueUpdate = true;
                          if(!updateImmediately){
                              continueUpdate = !$rootScope.saveInProgress;
                          }

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

                            },{
                                title: 'Form Title3',
                                admin: '2fab9ed873937f0e1dea0ce1',
                                language: 'english',
                                form_fields: [
                public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js on lines 12..22
                public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js on lines 24..34
                public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js on lines 34..44

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

                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

                        var sampleSubmissions = [{
                            form_fields: [
                                {fieldType:'textfield', title:'First Name', fieldValue: 'The Terminator', deletePreserved: false},
                                {fieldType:'checkbox', title:'nascar',      fieldValue: 0, deletePreserved: false},
                                {fieldType:'checkbox', title:'hockey',      fieldValue: 1, deletePreserved: false}
                public/modules/forms/tests/unit/directives/edit-form-submissions.client.directive.test.js on lines 90..100
                public/modules/forms/tests/unit/directives/edit-form-submissions.client.directive.test.js on lines 101..111

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

                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 4 locations. Consider refactoring.
                Open

                        var sampleForm = {
                            title: 'Form Title',
                            admin: 'ed873933b1f1dea0ce12fab9',
                            language: 'english',
                            form_fields: [
                public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js on lines 24..34
                public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js on lines 34..44
                public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js on lines 44..54

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

                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 4 locations. Consider refactoring.
                Open

                        var sampleFormList = [{
                                title: 'Form Title1',
                                admin: 'ed873933b1f1dea0ce12fab9',
                                language: 'english',
                                form_fields: [
                public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js on lines 12..22
                public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js on lines 34..44
                public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js on lines 44..54

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

                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