rosa-abf/rosa-build

View on GitHub
app/models/concerns/feed/comment.rb

Summary

Maintainability
B
6 hrs
Test Coverage

Showing 3 of 3 total issues

Method new_comment_notifications has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def new_comment_notifications
return if automatic?
 
if issue_comment?
commentable.subscribes.each do |subscribe|
Severity: Minor
Found in app/models/concerns/feed/comment.rb - About 3 hrs to fix

Method new_comment_notifications has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def new_comment_notifications
return if automatic?
 
if issue_comment?
commentable.subscribes.each do |subscribe|
Severity: Major
Found in app/models/concerns/feed/comment.rb - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

    if subscribe.user.notifier.can_notify && !own_comment?(subscribe.user)
    ( (subscribe.project.owner?(subscribe.user) && subscribe.user.notifier.new_comment_commit_repo_owner) ||
    (subscribe.user.commentor?(self.commentable) && subscribe.user.notifier.new_comment_commit_commentor) ||
    (subscribe.user.committer?(self.commentable) && subscribe.user.notifier.new_comment_commit_owner) )
    UserMailer.new_comment_notification(self, subscribe.user_id).deliver
    Severity: Major
    Found in app/models/concerns/feed/comment.rb - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status