mangroveorg/datawinners

View on GitHub

Showing 1,567 of 3,608 total issues

Avoid too many return statements within this function.
Open

            return convert_to_json_response({"ERROR_CODE": 101, "ERROR_MESSAGE": 'Invalid form code provided'}, 400)
Severity: Major
Found in datawinners/feeds/views.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return HttpResponse(content_type='application/json', content=json.dumps({
    Severity: Major
    Found in datawinners/blue/view.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return HttpResponse(content_type='application/json', content=json.dumps({
      Severity: Major
      Found in datawinners/blue/view.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return 'dd.mm.yyyy'
        Severity: Major
        Found in datawinners/blue/xform_bridge.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return {'main': excel_headers.get('single_sheet_headers')}
          Severity: Major
          Found in datawinners/blue/xform_submission_exporter.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return excel_headers #safe handling
            Severity: Major
            Found in datawinners/blue/xform_submission_exporter.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return xls_parser_response
              Severity: Major
              Found in datawinners/blue/view.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return convert_to_json_response({"ERROR_CODE": 104, "ERROR_MESSAGE": "You don't have access to this feed"}, 403)
                Severity: Major
                Found in datawinners/feeds/views.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return {field.code: value}
                  Severity: Major
                  Found in datawinners/blue/xform_bridge.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return HttpResponse(content_type='application/json', content=json.dumps({
                    Severity: Major
                    Found in datawinners/blue/view.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return _('%dth') % number
                      Severity: Major
                      Found in datawinners/utils.py - About 30 mins to fix

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

                        ol.control.LayerSwitcher = function(opt_options) {
                        
                            var options = opt_options || {};
                        
                            var tipLabel = options.tipLabel ?

                        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 sort has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            sort: function(id) {
                                SelectBox.cache[id].sort( function(a, b) {
                                    a = a.text.toLowerCase();
                                    b = b.text.toLowerCase();
                                    try {
                        Severity: Minor
                        Found in datawinners/media/admin/js/SelectBox.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 getDaysInMonth has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            getDaysInMonth: function(month,year) {
                                var days;
                                if (month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12) {
                                    days = 31;
                                }
                        Severity: Minor
                        Found in datawinners/media/admin/js/calendar.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 magicDate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function magicDate(input) {
                            var messagespan = input.id + 'Msg';
                            try {
                                var d = parseDateString(input.value);
                                input.value = d.getFullYear() + '-' + (fmt00(d.getMonth() + 1)) + '-' + 
                        Severity: Minor
                        Found in datawinners/media/admin/js/dateparse.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 filter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            filter: function(id, text) {
                                // Redisplay the HTML select box, displaying only the choices containing ALL
                                // the words in text. (It's an AND search.)
                                var tokens = text.toLowerCase().split(/\s+/);
                                var node, token;
                        Severity: Minor
                        Found in datawinners/media/admin/js/SelectBox.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 WeeklyReminder has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function WeeklyReminder(){
                            var self = this;
                            self.reminder_date = new Date();
                            self.calculate_deadline = function(selected_day){
                                var current_date = new Date();
                        Severity: Minor
                        Found in datawinners/media/javascript/project/reminder_settings.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 _init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            _init:function () {
                                var o = this.options;
                                this.container = o.container;
                                this.length = o.length;
                                this.height = o.height;
                        Severity: Minor
                        Found in datawinners/media/javascript/warning_dialog.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 QuestionnaireFetcher has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        DW.QuestionnaireFetcher = function(){
                           var questionnaireCache = null;
                           var questionnaireDataCache = {};
                        
                           this.getExistingQuestionnaireList = function(){
                        Severity: Minor
                        Found in datawinners/media/javascript/entity/questionnaire_fetcher.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 TemplateFetcher has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        DW.TemplateFetcher = function(){
                          var templateCache = {};
                          var templateGroupingDataCache = null;
                        
                          this.getTemplateData = function (templateId) {
                        Severity: Minor
                        Found in datawinners/media/javascript/entity/questionnaire_fetcher.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