nus-mtp/cs-modify

View on GitHub

Showing 75 of 2,705 total issues

Avoid too many return statements within this function.
Open

                return Outcome().POST("delete_module", True, module_code)
Severity: Major
Found in components/handlers/delete_module.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                                    return False
    Severity: Major
    Found in components/handlers/edit_all_mountings_and_quotas.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                                      return Outcome().POST("edit_all_mountings_and_quotas", False, None)
      Severity: Major
      Found in components/handlers/edit_all_mountings_and_quotas.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                            return False
        Severity: Major
        Found in components/helper.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                                      return Outcome().POST("edit_all_mountings_and_quotas", False, None)
          Severity: Major
          Found in components/handlers/edit_all_mountings_and_quotas.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return input_data
            Severity: Major
            Found in components/helper.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                  return Outcome().POST("edit_all_mountings_and_quotas", False, None)
              Severity: Major
              Found in components/handlers/edit_all_mountings_and_quotas.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return Outcome().POST("edit_all_mountings_and_quotas", False, None)
                Severity: Major
                Found in components/handlers/edit_all_mountings_and_quotas.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return Outcome().POST("edit_all_mountings_and_quotas", True, None)
                  Severity: Major
                  Found in components/handlers/edit_all_mountings_and_quotas.py - About 30 mins to fix

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

                    function toggleFilters() {
                        var elements = document.getElementsByClassName("filter")
                        if (elements[0].hasAttribute("hidden")) {
                            document.getElementById("chevron").className="glyphicon glyphicon-chevron-up"
                            for(var i=0; i < elements.length; i++) {
                    Severity: Minor
                    Found in static/javascripts/moduleListing.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 replace_null_with_dash has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def replace_null_with_dash(table):
                        '''
                            Changes all the NULL values found in the table to '-'
                            This function supports a 2D table.
                        '''
                    Severity: Minor
                    Found in components/helper.py - 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 get_quota_of_target_tenta_ay_sem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def get_quota_of_target_tenta_ay_sem(code, ay_sem):
                        '''
                            Get the quota of a mod in a target tentative AY/Sem (if any)
                        '''
                        number_of_attempts = 0
                    Severity: Minor
                    Found in components/database.py - 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 get_quota_of_target_fixed_ay_sem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def get_quota_of_target_fixed_ay_sem(code, ay_sem):
                        '''
                            Get the quota of a mod in a target fixed AY/Sem (if any)
                        '''
                        number_of_attempts = 0
                    Severity: Minor
                    Found in components/database.py - 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 load_fixed_mounting_plan has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def load_fixed_mounting_plan(self, module_code):
                            '''
                                Loads the fixed mounting plan of the single module
                            '''
                            fixed_mounting_and_quota = model.get_fixed_mounting_and_quota(module_code)
                    Severity: Minor
                    Found in components/handlers/module_overview.py - 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 highlightErrorFieldsPreclusion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function highlightErrorFieldsPreclusion(data) {
                        var modulesWithErrors = data;
                    
                        var rows = document.getElementsByTagName("tbody")[0].children;
                        var message_start = "<p><b>";
                    Severity: Minor
                    Found in static/javascripts/csmodify.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