Skip to content

Commit

Permalink
Merge pull request #93 from baynezy/feature/issue-92-sonar
Browse files Browse the repository at this point in the history
Resolve sonar recommendations
  • Loading branch information
baynezy authored Feb 12, 2024
2 parents 55b8973 + 4afe3f7 commit 7909bd5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .idea/.idea.NHSNumberGenerator/.idea/sonarlint.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/NHSNumberGenerator/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static string Generate()
return number.Calculate();
}

private class NhsNumber
private sealed class NhsNumber
{

private readonly Random _random = new();
Expand Down Expand Up @@ -51,13 +51,13 @@ private int RandomDigit()
return _random.Next(0, 10);
}

private class NumberPart
private sealed class NumberPart
{
internal int Number { get; init; }

internal int Factor { get; init; }

public int Calculate()
internal int Calculate()
{
return Number * Factor;
}
Expand Down

0 comments on commit 7909bd5

Please sign in to comment.