schneidmaster/gitreports.com

View on GitHub

Showing 6 of 6 total issues

Method parse_emails has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def parse_emails(emails)
    valid_emails = []
    unless emails.nil?
      emails.split(/,|\n/).each do |full_email|
        next if full_email.blank?
Severity: Minor
Found in app/controllers/repositories_controller.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 add_repos has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def add_repos(repos, user)
      found_repo_ids = []
      found_org_names = []

      repos.select(&:has_issues).each do |api_repo|
Severity: Minor
Found in app/services/github_service.rb - About 1 hr to fix

    Method add_repos has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def add_repos(repos, user)
          found_repo_ids = []
          found_org_names = []
    
          repos.select(&:has_issues).each do |api_repo|
    Severity: Minor
    Found in app/services/github_service.rb - About 55 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

    Method submit_issue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def submit_issue(repo_id, sub_name, email, email_public, title, details)
          # Find repo
          repo = Repository.find(repo_id)
    
          # Determine title
    Severity: Minor
    Found in app/services/github_service.rb - About 45 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

    Method submit_issue has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def submit_issue(repo_id, sub_name, email, email_public, title, details)
    Severity: Minor
    Found in app/services/github_service.rb - About 45 mins to fix

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

        def construct_body(sub_name, email, email_public, details)
          body = ''
          body += "Submitter: #{sub_name}\r\n" unless sub_name.blank?
          body += "Email: #{email}\r\n" if email_public == 'on' && email.present?
          body += details unless details.blank?
      Severity: Minor
      Found in app/models/repository.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

      Severity
      Category
      Status
      Source
      Language