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

NLogMessageParameterList - Reduce code complexity for IsValidParameterList #334

Merged
merged 1 commit into from
Sep 21, 2019

Conversation

snakefoot
Copy link
Contributor

2nd try :)

@snakefoot snakefoot force-pushed the LoggerBuilderAddNLogLifetime branch 3 times, most recently from 257b77f to fa66951 Compare September 16, 2019 22:07
@codecov-io
Copy link

codecov-io commented Sep 16, 2019

Codecov Report

Merging #334 into master will decrease coverage by 0.09%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #334     +/-   ##
=========================================
- Coverage   81.98%   81.88%   -0.1%     
=========================================
  Files          12       12             
  Lines        1110     1104      -6     
  Branches      195      193      -2     
=========================================
- Hits          910      904      -6     
  Misses        136      136             
  Partials       64       64
Impacted Files Coverage Δ
...nsions.Logging/Logging/NLogMessageParameterList.cs 91.36% <75%> (-0.36%) ⬇️

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 c6579b5...6a188d8. Read the comment docs.

Copy link
Member

@304NotModified 304NotModified left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you trying to reduce the complexity? In short the (almost) only way is to split out code to another method/class (when keeping the same semantics)

if (!isPositional && i != 0)
isMixedPositional = true;
if (!isPositional)
isMixedPositional = i != 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The semantics changed here. Is that on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the result is the same. But one less condition.

{
hasMessageTemplateCapture = true;
}
isMixedPositional = isPositional;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Same here)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the result is the same. But less conditions.

@snakefoot
Copy link
Contributor Author

@304NotModified Are you trying to reduce the complexity?

Yes while keeping performance

@304NotModified 304NotModified added this to the 1.5.5 milestone Sep 21, 2019
@304NotModified 304NotModified merged commit 38d3410 into NLog:master Sep 21, 2019
@304NotModified
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants