mysociety/alaveteli

View on GitHub
app/helpers/info_request_helper.rb

Summary

Maintainability
A
1 hr
Test Coverage

File info_request_helper.rb has 291 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

module InfoRequestHelper
  include ConfigHelper
  include DateTimeHelper
  include LinkToHelper

Severity: Minor
Found in app/helpers/info_request_helper.rb - About 3 hrs to fix

    Method status_text_waiting_response_very_overdue has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Wontfix

      def status_text_waiting_response_very_overdue(info_request, _opts = {})
        str = _('Response to this request is <strong>long overdue</strong>.')
        str += ' '
        if info_request.public_body.not_subject_to_law?
          str += _('Although not legally required to do so, we would have ' \
    Severity: Minor
    Found in app/helpers/info_request_helper.rb - About 1 hr to fix

      Method status_text_waiting_clarification has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def status_text_waiting_clarification(info_request, opts = {})
          is_owning_user = opts.fetch(:is_owning_user)
      
          str = ''.html_safe
      
      
      Severity: Minor
      Found in app/helpers/info_request_helper.rb - About 1 hr to fix

        Method status_text_waiting_clarification has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def status_text_waiting_clarification(info_request, opts = {})
            is_owning_user = opts.fetch(:is_owning_user)
        
            str = ''.html_safe
        
        
        Severity: Minor
        Found in app/helpers/info_request_helper.rb - 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

        There are no issues that match your filters.

        Category
        Status