Skip to content

Commit

Permalink
sonarcloud code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
will-craig committed Jul 2, 2023
1 parent 23dd507 commit 300c2d6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions AdminWebsite/AdminWebsite/Services/HearingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public bool IsAddingParticipantOnly(EditHearingRequest editHearingRequest,
var originalParticipants = hearingDetailsResponse.Participants.Where(x=>x.HearingRoleName != HearingRoleName.StaffMember)
.Select(EditParticipantRequestMapper.MapFrom).ToList();
var requestParticipants = editHearingRequest.Participants.FindAll(x=>x.HearingRoleName != HearingRoleName.StaffMember);
var hearingCase = hearingDetailsResponse.Cases.First();
var hearingCase = hearingDetailsResponse.Cases[0];

var addedParticipant = GetAddedParticipant(originalParticipants, requestParticipants);

Expand All @@ -82,10 +82,10 @@ public bool IsUpdatingJudge(EditHearingRequest editHearingRequest,
HearingDetailsResponse hearingDetailsResponse)
{
var existingJudge =
hearingDetailsResponse.Participants.FirstOrDefault(
hearingDetailsResponse.Participants.Find(
x => x.HearingRoleName == HearingRoleName.Judge);
var newJudge =
editHearingRequest.Participants.FirstOrDefault(x => x.HearingRoleName == HearingRoleName.Judge);
editHearingRequest.Participants.Find(x => x.HearingRoleName == HearingRoleName.Judge);
var existingJudgeOtherInformation = HearingDetailsResponseExtensions.GetJudgeOtherInformationString(hearingDetailsResponse.OtherInformation);
var newJudgeOtherInformation = HearingDetailsResponseExtensions.GetJudgeOtherInformationString(editHearingRequest.OtherInformation);

Expand Down Expand Up @@ -151,7 +151,7 @@ public async Task<ParticipantRequest> ProcessNewParticipant(
|| (!ejudFeatureFlag && participant.CaseRoleName == RoleNames.Judge))
{
if (hearing.Participants != null &&
hearing.Participants.Any(p => p.ContactEmail.Equals(participant.ContactEmail) && removedParticipantIds.All(removedParticipantId => removedParticipantId != p.Id)))
hearing.Participants.Exists(p => p.ContactEmail.Equals(participant.ContactEmail) && removedParticipantIds.All(removedParticipantId => removedParticipantId != p.Id)))
{
//If the judge already exists in the database, there is no need to add again.
return null;
Expand Down

0 comments on commit 300c2d6

Please sign in to comment.