mingujo/UCBerkeley_Housing

View on GitHub
app/helpers/fetch_sheets.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Method detect_change_send_email has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def detect_change_send_email(info_list)
    str_date = info_list[0][0].split(" ")[0]
    str_date = str_date.split('/')
    str_date = str_date[1]+'/'+str_date[0]+'/'+str_date[2]
    # ONE SAD PATH: if there is no ca and scheduler puts the client name, it will error out
Severity: Minor
Found in app/helpers/fetch_sheets.rb - About 1 hr 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

Method update_ts has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def update_ts(ts, client_name, phone_number, apt_number, current_tenant)
Severity: Minor
Found in app/helpers/fetch_sheets.rb - About 35 mins to fix

    There are no issues that match your filters.

    Category
    Status