mangroveorg/datawinners

View on GitHub

Showing 3,608 of 3,608 total issues

Function utils has 417 lines of code (exceeds 25 allowed). Consider refactoring.
Open

ko.utils = (function () {
    var objectForEach = function(obj, action) {
        for (var prop in obj) {
            if (obj.hasOwnProperty(prop)) {
                action(prop, obj[prop]);

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

    def create_project14(manager, questions):
        questionnaire14 = Project(manager, name="Clinic DS W/O Monthly Submission (following)",
                                    form_code="cli014",
                                    fields=questions, goals="This project is for automation",
                                    devices=["sms", "web", "smartPhone"], sender_group="close"
    Severity: Major
    Found in datawinners/main/ut_couch_fixtures.py and 5 other locations - About 2 days to fix
    datawinners/main/ut_couch_fixtures.py on lines 283..317
    datawinners/main/ut_couch_fixtures.py on lines 320..354
    datawinners/main/ut_couch_fixtures.py on lines 393..428
    datawinners/main/ut_couch_fixtures.py on lines 431..467
    datawinners/main/ut_couch_fixtures.py on lines 509..544

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

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

    def create_project12(manager, questions):
        questionnaire12 = Project(manager, name="Clinic DS W/O Submission (That)",
                                    form_code="cli012",
                                    fields=questions, goals="This project is for automation",
                                    devices=["sms", "web", "smartPhone"], sender_group="close"
    Severity: Major
    Found in datawinners/main/ut_couch_fixtures.py and 5 other locations - About 2 days to fix
    datawinners/main/ut_couch_fixtures.py on lines 283..317
    datawinners/main/ut_couch_fixtures.py on lines 320..354
    datawinners/main/ut_couch_fixtures.py on lines 431..467
    datawinners/main/ut_couch_fixtures.py on lines 470..506
    datawinners/main/ut_couch_fixtures.py on lines 509..544

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

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

    def create_project15(manager, questions):
        questionnaire15 = Project(manager, name="Clinic All DS Monthly Submission (following)",
                                    form_code="cli015",
                                    fields=questions, goals="This project is for automation",
                                    devices=["sms", "web", "smartPhone"], sender_group="close"
    Severity: Major
    Found in datawinners/main/ut_couch_fixtures.py and 5 other locations - About 2 days to fix
    datawinners/main/ut_couch_fixtures.py on lines 283..317
    datawinners/main/ut_couch_fixtures.py on lines 320..354
    datawinners/main/ut_couch_fixtures.py on lines 393..428
    datawinners/main/ut_couch_fixtures.py on lines 431..467
    datawinners/main/ut_couch_fixtures.py on lines 470..506

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

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

    def create_project11(manager, questions):
        questionnaire11 = Project(manager, name="Clinic All DS (Following)",
                                    form_code="cli011",
                                    fields=questions, goals="This project is for automation",
                                    devices=["sms", "web", "smartPhone"], sender_group="close"
    Severity: Major
    Found in datawinners/main/ut_couch_fixtures.py and 5 other locations - About 2 days to fix
    datawinners/main/ut_couch_fixtures.py on lines 320..354
    datawinners/main/ut_couch_fixtures.py on lines 393..428
    datawinners/main/ut_couch_fixtures.py on lines 431..467
    datawinners/main/ut_couch_fixtures.py on lines 470..506
    datawinners/main/ut_couch_fixtures.py on lines 509..544

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

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

    def create_project10(manager, questions):
        questionnaire10 = Project(manager, name="Clinic DS W/O Submission (Following)",
                                    form_code="cli010",
                                    fields=questions, goals="This project is for automation",
                                    devices=["sms", "web", "smartPhone"], sender_group="close"
    Severity: Major
    Found in datawinners/main/ut_couch_fixtures.py and 5 other locations - About 2 days to fix
    datawinners/main/ut_couch_fixtures.py on lines 283..317
    datawinners/main/ut_couch_fixtures.py on lines 393..428
    datawinners/main/ut_couch_fixtures.py on lines 431..467
    datawinners/main/ut_couch_fixtures.py on lines 470..506
    datawinners/main/ut_couch_fixtures.py on lines 509..544

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

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

    def create_project13(manager, questions):
        questionnaire13 = Project(manager, name="clinic13 test project",
                                    form_code="cli013",
                                    fields=questions, goals="This project is for automation",
                                    devices=["sms", "web", "smartPhone"], sender_group="close"
    Severity: Major
    Found in datawinners/main/ut_couch_fixtures.py and 5 other locations - About 2 days to fix
    datawinners/main/ut_couch_fixtures.py on lines 283..317
    datawinners/main/ut_couch_fixtures.py on lines 320..354
    datawinners/main/ut_couch_fixtures.py on lines 393..428
    datawinners/main/ut_couch_fixtures.py on lines 470..506
    datawinners/main/ut_couch_fixtures.py on lines 509..544

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

    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 fileuploader.js has 853 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * http://github.com/valums/file-uploader
     * 
     * Multiple file upload component with progress-bar, drag-and-drop. 
     * © 2010 Andrew Valums ( andrew(at)valums.com ) 
    Severity: Major
    Found in datawinners/media/javascript/file_uploader/fileuploader.js - About 2 days to fix

      File underscore.js has 846 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      //     Underscore.js 1.4.3
      //     http://underscorejs.org
      //     (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
      //     Underscore may be freely distributed under the MIT license.
      
      
      Severity: Major
      Found in datawinners/media/javascript/underscore.js - About 2 days to fix

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

            models = {
                'accountmanagement.organization': {
                    'Meta': {'object_name': 'Organization'},
                    'active_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
                    'address': ('django.db.models.fields.TextField', [], {}),
        datawinners/submission/migrations/0004_get_organizations.py on lines 23..50

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

        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

            models = {
                'accountmanagement.organization': {
                    'Meta': {'object_name': 'Organization'},
                    'active_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
                    'address': ('django.db.models.fields.TextField', [], {}),
        Severity: Major
        Found in datawinners/submission/migrations/0004_get_organizations.py and 1 other location - About 2 days to fix
        datawinners/submission/migrations/0003_auto__add_field_datawinnerlog_organization.py on lines 21..48

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

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

        if(date instanceof Date&&!isNaN(date)){return(this>date)?1:(this<date)?-1:0;}else{throw new TypeError(date);}};Date.prototype.equals=function(date){return(this.compareTo(date)===0);};Date.prototype.between=function(start,end){var t=this.getTime();return t>=start.getTime()&&t<=end.getTime();};Date.prototype.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};Date.prototype.addSeconds=function(value){return this.addMilliseconds(value*1000);};Date.prototype.addMinutes=function(value){return this.addMilliseconds(value*60000);};Date.prototype.addHours=function(value){return this.addMilliseconds(value*3600000);};Date.prototype.addDays=function(value){return this.addMilliseconds(value*86400000);};Date.prototype.addWeeks=function(value){return this.addMilliseconds(value*604800000);};Date.prototype.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(value){return this.addMonths(value*12);};Date.prototype.add=function(config){if(typeof config=="number"){this._orient=config;return this;}
        var x=config;if(x.millisecond||x.milliseconds){this.addMilliseconds(x.millisecond||x.milliseconds);}
        if(x.second||x.seconds){this.addSeconds(x.second||x.seconds);}
        if(x.minute||x.minutes){this.addMinutes(x.minute||x.minutes);}
        if(x.hour||x.hours){this.addHours(x.hour||x.hours);}
        datawinners/media/javascript/dateRangePicker/js/daterangepicker.jQuery.js on lines 407..415
        datawinners/media/javascript/dateRangePicker/js/daterangepicker.jQuery.withoutdrilldown.js on lines 236..244

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

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

        if(date instanceof Date&&!isNaN(date)){return(this>date)?1:(this<date)?-1:0;}else{throw new TypeError(date);}};Date.prototype.equals=function(date){return(this.compareTo(date)===0);};Date.prototype.between=function(start,end){var t=this.getTime();return t>=start.getTime()&&t<=end.getTime();};Date.prototype.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};Date.prototype.addSeconds=function(value){return this.addMilliseconds(value*1000);};Date.prototype.addMinutes=function(value){return this.addMilliseconds(value*60000);};Date.prototype.addHours=function(value){return this.addMilliseconds(value*3600000);};Date.prototype.addDays=function(value){return this.addMilliseconds(value*86400000);};Date.prototype.addWeeks=function(value){return this.addMilliseconds(value*604800000);};Date.prototype.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(value){return this.addMonths(value*12);};Date.prototype.add=function(config){if(typeof config=="number"){this._orient=config;return this;}
        var x=config;if(x.millisecond||x.milliseconds){this.addMilliseconds(x.millisecond||x.milliseconds);}
        if(x.second||x.seconds){this.addSeconds(x.second||x.seconds);}
        if(x.minute||x.minutes){this.addMinutes(x.minute||x.minutes);}
        if(x.hour||x.hours){this.addHours(x.hour||x.hours);}
        datawinners/media/javascript/dateRangePicker/js/daterangepicker.jQuery.custom.js on lines 424..432
        datawinners/media/javascript/dateRangePicker/js/daterangepicker.jQuery.js on lines 407..415

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

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

        if(date instanceof Date&&!isNaN(date)){return(this>date)?1:(this<date)?-1:0;}else{throw new TypeError(date);}};Date.prototype.equals=function(date){return(this.compareTo(date)===0);};Date.prototype.between=function(start,end){var t=this.getTime();return t>=start.getTime()&&t<=end.getTime();};Date.prototype.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};Date.prototype.addSeconds=function(value){return this.addMilliseconds(value*1000);};Date.prototype.addMinutes=function(value){return this.addMilliseconds(value*60000);};Date.prototype.addHours=function(value){return this.addMilliseconds(value*3600000);};Date.prototype.addDays=function(value){return this.addMilliseconds(value*86400000);};Date.prototype.addWeeks=function(value){return this.addMilliseconds(value*604800000);};Date.prototype.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(value){return this.addMonths(value*12);};Date.prototype.add=function(config){if(typeof config=="number"){this._orient=config;return this;}
        var x=config;if(x.millisecond||x.milliseconds){this.addMilliseconds(x.millisecond||x.milliseconds);}
        if(x.second||x.seconds){this.addSeconds(x.second||x.seconds);}
        if(x.minute||x.minutes){this.addMinutes(x.minute||x.minutes);}
        if(x.hour||x.hours){this.addHours(x.hour||x.hours);}
        datawinners/media/javascript/dateRangePicker/js/daterangepicker.jQuery.custom.js on lines 424..432
        datawinners/media/javascript/dateRangePicker/js/daterangepicker.jQuery.withoutdrilldown.js on lines 236..244

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

        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

            def forwards(self, orm):
                
                # Changing field 'Distribution.q5'
                db.alter_column('crs_distribution', 'oil', self.gf('django.db.models.fields.FloatField')(null=True, db_column='oil'))
        
        
        datawinners/custom_reports/crs/migrations/0003_auto__chg_field_distribution_q5__chg_field_distribution_q7__chg_field_.py on lines 36..60

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

        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

            def backwards(self, orm):
                
                # Changing field 'Distribution.q5'
                db.alter_column('crs_distribution', 'oil', self.gf('django.db.models.fields.FloatField')(default=None, db_column='oil'))
        
        
        datawinners/custom_reports/crs/migrations/0003_auto__chg_field_distribution_q5__chg_field_distribution_q7__chg_field_.py on lines 9..33

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

        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 validation-ui-tests.js has 816 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*global
            module:false,
            equal:false,
            notEqual:false,
            strictEqual:false,

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

              var rpPresets = (function(){
          
                  var ul = jQuery('<ul class="ui-widget-content"></ul>').appendTo(rp);
                  var x=0;
                  jQuery.each(options.presets, function(key, value) {
          datawinners/media/javascript/dateRangePicker/js/daterangepicker.jQuery.js on lines 118..149

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

          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 rpPresets = (function(){
          
                  var ul = jQuery('<ul class="ui-widget-content"></ul>').appendTo(rp);
                  var x=0;
                  jQuery.each(options.presets, function(key, value) {
          datawinners/media/javascript/dateRangePicker/js/daterangepicker.jQuery.custom.js on lines 118..149

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

          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 xform_bridge.py has 802 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import csv
          from datetime import datetime
          import itertools
          import os
          import re
          Severity: Major
          Found in datawinners/blue/xform_bridge.py - About 1 day to fix
            Severity
            Category
            Status
            Source
            Language