Skip to content

Commit

Permalink
Sonar suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
killij committed Sep 20, 2023
1 parent 261b7a6 commit c71f0ba
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Childrens-Social-Care-CPD/Views/Content/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

@section Hero {
@{
var heroBanner = Model.Items?.FirstOrDefault(x => x.GetType() == typeof(HeroBanner));
var heroBanner = Model.Items?.Find(x => x.GetType() == typeof(HeroBanner));
if (heroBanner != null)
{
<partial name="_HeroBanner" model="heroBanner" />
Expand Down
4 changes: 0 additions & 4 deletions Childrens-Social-Care-CPD/Views/Cookie/Cookies.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
@inject ICookieHelper _cookieHelper
@inject IRenderer<ContentLink> _contentLinkRenderer

@{
var prefsHaveBeenSet = _cookieHelper.GetRequestAnalyticsCookieState(Context) != AnalyticsConsentState.NotSet;
}

@if (ViewBag.ContextModel.PreferenceSet)
{
<div class="govuk-grid-row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
switch (Model.Type)
{
case "Extra Large" :
<hr class="govuk-section-break govuk-section-break--xl govuk-section-break--visible">;
<hr class="govuk-section-break govuk-section-break--xl govuk-section-break--visible">
break;
case "Large" :
<hr class="govuk-section-break govuk-section-break--l govuk-section-break--visible">;
<hr class="govuk-section-break govuk-section-break--l govuk-section-break--visible">
break;
case "Medium":
<hr class="govuk-section-break govuk-section-break--m govuk-section-break--visible">
; break;
break;
case "Small":
<hr class="govuk-section-break govuk-section-break--s govuk-section-break--visible">
; break;
break;
}
}
19 changes: 9 additions & 10 deletions Childrens-Social-Care-CPD/Views/Shared/_RichText.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,18 @@
case HorizontalRuler hr: @_horizontalRulerRenderer.Render(hr); break;
case Paragraph paragraph: @_paragraphRenderer.Render(paragraph); break;
case List list: @_listRenderer.Render(list); break;
case Heading1 heading1: @_heading1Renderer.Render(heading1); break;
case Heading2 heading2: @_heading2Renderer.Render(heading2); break;
case Heading3 heading3: @_heading3Renderer.Render(heading3); break;
case Heading4 heading4: @_heading4Renderer.Render(heading4); break;
case Heading5 heading5: @_heading5Renderer.Render(heading5); break;
case Heading6 heading6: @_heading6Renderer.Render(heading6); break;
case Table table: @_tableRenderer.Render(table); break;
case Quote quote: @_quoteRenderer.Render(quote)
; break;
case Heading1 heading1: @_heading1Renderer.Render(heading1) break;
case Heading2 heading2: @_heading2Renderer.Render(heading2) break;
case Heading3 heading3: @_heading3Renderer.Render(heading3) break;
case Heading4 heading4: @_heading4Renderer.Render(heading4) break;
case Heading5 heading5: @_heading5Renderer.Render(heading5) break;
case Heading6 heading6: @_heading6Renderer.Render(heading6) break;
case Table table: @_tableRenderer.Render(table) break;
case Quote quote: @_quoteRenderer.Render(quote) break;
case EntryStructure entryStructure: {
switch (entryStructure.Data.Target)
{
case RoleList roleList: @_roleListRenderer.Render(roleList); break;
case RoleList roleList: @_roleListRenderer.Render(roleList) break;
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
var tagBuilder = new TagBuilder($"h{level}");
tagBuilder.InnerHtml.Append(Model.Title);

@tagBuilder;
@tagBuilder
}
}
}
Expand Down

0 comments on commit c71f0ba

Please sign in to comment.