Skip to content

Commit

Permalink
chore: Sonarcloud complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
jimwashbrook committed Oct 1, 2024
1 parent 90d064a commit eef3cb5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public class RichTextContentItem : CsContentItem
public string? Value { get; set; } = null;
public List<string> Tags { get; set; } = [];

public virtual bool HaveNoContent => Content.Count == 0 || Content.All(content => content.IsEmptyContent);
public virtual bool HaveNoContent => Content.Count == 0 || Content.TrueForAll(content => content.IsEmptyContent);
public virtual bool IsEmptyContent => HaveNoContent && string.IsNullOrEmpty(Value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ public EmbeddedEntry()
public RichTextContentItem? RichText { get; set; }
public CustomComponent? CustomComponent { get; set; }

public override bool HaveNoContent => Content.Count == 0 || Content.All(content => content.IsEmptyContent);
public override bool IsEmptyContent => base.IsEmptyContent && (RichText == null || (RichText != null && RichText.IsEmptyContent));
public override bool HaveNoContent => Content.Count == 0 || Content.TrueForAll(content => content.IsEmptyContent);
public override bool IsEmptyContent => base.IsEmptyContent && (RichText == null || RichText.IsEmptyContent);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
}
else
{
var textContainsOpenInNewTab = @Model.Content[0].Value.ToLower().Contains("(opens in new tab)");
var textContainsOpenInNewTab = Model.Content[0].Value?.ToLower().Contains("(opens in new tab)") ?? false;
var linkClass = textContainsOpenInNewTab ? "opens-in-new-tab" : "";
if(textContainsOpenInNewTab){
Model.Content[0].Value = @Model.Content[0].Value.Replace(" (opens in new tab)", "");
Model.Content[0].Value = Model.Content[0].Value?.Replace(" (opens in new tab)", "") ?? "";
}

<a href="@Model.Uri" target="_blank" rel="noopener noreferrer" class="@linkClass">@Model.Content[0].Value</a>
Expand Down

0 comments on commit eef3cb5

Please sign in to comment.