Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HAST-164: SDK static code analysis integration #3

Merged
merged 49 commits into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
878d0d7
Fix documentation and spacing issues in Lombiq.Arithmetics.
sarahelsaig Jun 24, 2021
7722912
Fix all missing parenthesis.
sarahelsaig Jun 25, 2021
71809b1
Remove trailing whitespace across the solution.
sarahelsaig Dec 14, 2021
0e3ed71
Fix S103 across the solution.
sarahelsaig Dec 14, 2021
f5685a6
Fix SA1507 (spacing).
sarahelsaig Dec 15, 2021
a13041f
Fix SA1139 (Use literal suffix notation instead of casting).
sarahelsaig Dec 15, 2021
bb7c8fb
Remove unnecessary usings.
sarahelsaig Dec 16, 2021
e86fbe1
Fix SA1116 (The parameters should begin on the line after the declara…
sarahelsaig Dec 16, 2021
87cf9f4
Fix SA1117(The parameters should all be placed on the same line or ea…
sarahelsaig Dec 16, 2021
1c0fcbb
Fix SA1413(Use trailing comma in multi-line initializers)
sarahelsaig Dec 16, 2021
b3bc247
Fix QuireTests.
sarahelsaig Dec 16, 2021
274d282
Fix S2148 (Add underscores to this numeric value for readability).
sarahelsaig Dec 16, 2021
fd9108d
Fix IDE0047 (Parentheses can be removed).
sarahelsaig Dec 16, 2021
13d3a0a
Fix S1481 (Remove the unused local variables).
sarahelsaig Dec 16, 2021
85c0fd6
Fix IDE0090 ('new' expression can be simplified).
sarahelsaig Dec 17, 2021
ad9a01e
Replace single line methods.
sarahelsaig Dec 17, 2021
493e35f
Fix CA1822 (Member does not access instance data and can be marked as…
sarahelsaig Dec 17, 2021
b120676
Add readonly.
sarahelsaig Dec 17, 2021
2057588
Fix IDE0004 (Cast is redundant).
sarahelsaig Dec 17, 2021
27505f4
Fix S3257 (Remove the array type; it is redundant).
sarahelsaig Dec 17, 2021
5b14bf9
Fix S125 (Remove this commented out code).
sarahelsaig Dec 17, 2021
f569d4b
Fix SA1520 (Use braces consistently).
sarahelsaig Dec 17, 2021
64313ad
Fix SA1513 (Closing brace should be followed by blank line).
sarahelsaig Dec 17, 2021
9a20fcc
Fix SA1128 and CA1305.
sarahelsaig Dec 17, 2021
6a321e9
Fix SA1505 (An opening brace should not be followed by a blank line).
sarahelsaig Dec 17, 2021
1da205c
Fix SA1108 and SA1117.
sarahelsaig Dec 17, 2021
2461b95
Fix IDE0021 (Use expression body for constructors).
sarahelsaig Dec 18, 2021
fff4b8f
Fix S113 (Add a new line at the end of the file).
sarahelsaig Dec 18, 2021
f339657
Fix Posit32Tests.
sarahelsaig Dec 18, 2021
22dd16c
More ternary usage.
sarahelsaig Dec 18, 2021
34a7de2
Fix Posit.
sarahelsaig Dec 18, 2021
8e81a82
Refactor BitMask.
sarahelsaig Dec 18, 2021
6beedb1
Posit32 refactor.
sarahelsaig Dec 18, 2021
4dc92fe
Fix UnumHelper.
sarahelsaig Dec 18, 2021
800f228
Fix UnumConfiguration.
sarahelsaig Dec 18, 2021
1666ccd
Fix UnumEnvironment.
sarahelsaig Dec 18, 2021
b17dd7d
Refactor Quire and Unum.
sarahelsaig Dec 18, 2021
e067574
Go back to Quire.Segments property because Hastlayer can't deal with …
sarahelsaig Dec 18, 2021
5a23edf
Fix transformation issue in Quire equation op.
sarahelsaig Dec 18, 2021
28a93ae
Fix CA1825 (Use Array.Empty<uint>() instead).
sarahelsaig Dec 18, 2021
b9d00dc
Fix Lombiq.Arithmetics.Tests.
sarahelsaig Dec 18, 2021
487ae08
Update note on CA1819.
sarahelsaig Dec 20, 2021
00b207f
Revert CompatibilityAssert.
sarahelsaig Dec 20, 2021
88a4443
Make test project files more uniform.
sarahelsaig Dec 21, 2021
6c788de
Remove unnecessary "Service" entries from csproj.
sarahelsaig Dec 21, 2021
ff50594
Update Shouldly to the same version
sarahelsaig Dec 21, 2021
4bbd391
Update Posit/Posit.cs
sarahelsaig Dec 22, 2021
0ea1c54
Update Posit/Quire.cs
sarahelsaig Dec 22, 2021
b316660
Remove unintelligible comment
sarahelsaig Dec 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix CA1822 (Member does not access instance data and can be marked as…
… static).
  • Loading branch information
sarahelsaig committed Dec 17, 2021
commit 493e35f826ee6baf13ca17026f40f9788a28947e
2 changes: 1 addition & 1 deletion Lombiq.Arithmetics.Tests/UnumTests/UnumEnvironmentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public void UnumLargestNegativeIsCorrect()
TestFailureMessageBuilder(_unum_3_4, nameof(_unum_3_4.LargestNegative)));
}

private string TestFailureMessageBuilder(Unum unum, string propertyName) =>
private static string TestFailureMessageBuilder(Unum unum, string propertyName) =>
$"Testing the \"{propertyName}\" property of the Unum ({unum.ExponentSizeSize}, {unum.FractionSizeSize}) environment failed.";
}
}
20 changes: 0 additions & 20 deletions Posit/Posit32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,26 +258,6 @@ public static uint EncodeRegimeBits(int regimeKValue)
return regimeBits;
}

private uint AssemblePositBits(bool signBit, int regimeKValue, uint exponentBits, uint fractionBits)
{
// Calculating the regime.
var wholePosit = EncodeRegimeBits(regimeKValue);

// Attaching the exponent
var regimeLength = LengthOfRunOfBits(wholePosit, FirstRegimeBitPosition);

wholePosit += exponentBits << (SizeMinusFixedBits - regimeLength);

var fractionMostSignificantOneIndex = GetMostSignificantOnePosition(fractionBits) - 1;

// Hiding the hidden bit. (It is always one.)
fractionBits = SetZero(fractionBits, (ushort)fractionMostSignificantOneIndex);

wholePosit += fractionBits << (SizeMinusFixedBits - fractionMostSignificantOneIndex - regimeLength);

return signBit ? GetTwosComplement(wholePosit) : wholePosit;
}

public static uint AssemblePositBitsWithRounding(bool signBit, int regimeKValue, uint exponentBits, uint fractionBits)
{
// Calculating the regime.
Expand Down