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

Simplify overly complex boolean expressions #472

Merged

Conversation

JamieMagee
Copy link
Member

Example Replacement
condition ? true : false condition
condition ? false : true !condition
value == null ? null : value value
result != 0 ? result : 0 result
a == b ? a : b b

|Example|Replacement|
|-|-|
|`condition ? true : false`|`condition`|
|`condition ? false : true`|`!condition`|
|`value == null ? null : value`|`value`|
|`result != 0 ? result : 0`|`result`|
|`a == b ? a : b`|`b`|
@codecov-io
Copy link

codecov-io commented Sep 1, 2017

Codecov Report

Merging #472 into dev will increase coverage by 0.02%.
The diff coverage is 50%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev     #472      +/-   ##
============================================
+ Coverage     46.26%   46.29%   +0.02%     
- Complexity     2201     2204       +3     
============================================
  Files           108      108              
  Lines         25227    25227              
  Branches       4172     4170       -2     
============================================
+ Hits          11672    11679       +7     
+ Misses        11538    11526      -12     
- Partials       2017     2022       +5
Flag Coverage Δ Complexity Δ
#JDBC41 46.09% <50%> (+0.02%) 2194 <0> (+2) ⬆️
#JDBC42 46.1% <50%> (-0.01%) 2195 <0> (-2)
Impacted Files Coverage Δ Complexity Δ
...in/java/com/microsoft/sqlserver/jdbc/IOBuffer.java 53.78% <ø> (+0.43%) 0 <0> (ø) ⬇️
...n/java/com/microsoft/sqlserver/jdbc/Parameter.java 62.23% <ø> (-0.43%) 63 <0> (-1)
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 45.8% <0%> (ø) 274 <0> (ø) ⬇️
...om/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java 52.58% <0%> (-0.07%) 240 <0> (+1)
...m/microsoft/sqlserver/jdbc/SQLServerDataTable.java 58.06% <100%> (+0.8%) 23 <0> (ø) ⬇️
...rc/main/java/com/microsoft/sqlserver/jdbc/dtv.java 63.24% <100%> (ø) 0 <0> (ø) ⬇️
src/main/java/com/microsoft/sqlserver/jdbc/AE.java 73.95% <100%> (ø) 0 <0> (ø) ⬇️
...om/microsoft/sqlserver/jdbc/ReaderInputStream.java 42.69% <0%> (-4.5%) 15% <0%> (-1%)
...rc/main/java/com/microsoft/sqlserver/jdbc/DDC.java 44.71% <0%> (-0.23%) 105% <0%> (+1%)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a13577...0deeff6. Read the comment docs.

@ajlam
Copy link
Member

ajlam commented Sep 5, 2017

Thanks for your contributions @JamieMagee. We'll review and try to merge your PRs in the next preview release.

@ajlam ajlam modified the milestone: 6.3.3 Sep 5, 2017
@cheenamalhotra cheenamalhotra merged commit 75d60b1 into microsoft:dev Sep 21, 2017
@JamieMagee JamieMagee deleted the simplify-boolean-expressions branch September 22, 2017 09:18
@lilgreenbird lilgreenbird added this to Closed/Merged PRs in MSSQL JDBC Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
MSSQL JDBC
  
Closed/Merged PRs
Development

Successfully merging this pull request may close these issues.

None yet

5 participants