doorstop-dev / doorstop

Requirements management using version control.
https://doorstop.readthedocs.io
Other
474 stars 132 forks source link

Restructure code to reduce code duplication and cognitive complexity. #571

Closed neerdoc closed 2 years ago

neerdoc commented 2 years ago

Restructured the code in publisher_latex.py mostly as it was way too long and complex.

Also read through some of the issues in Scrutinizer and tried to fix them too, although I do not have Scrutinizer set up on my fork, so I ran it on sonarcloud instead. The changes should regardless increase the Scrutinizer score (I hope!).

Fixed #570 by adding some comments and a new assert.

codecov-commenter commented 2 years ago

Codecov Report

Merging #571 (bd03f56) into develop (fba23e8) will decrease coverage by 0.00%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop     #571      +/-   ##
===========================================
- Coverage    95.54%   95.53%   -0.01%     
===========================================
  Files           35       35              
  Lines         4620     4636      +16     
  Branches       912      911       -1     
===========================================
+ Hits          4414     4429      +15     
- Misses         124      125       +1     
  Partials        82       82              
Impacted Files Coverage Δ
doorstop/core/publisher_latex.py 100.00% <100.00%> (ø)
doorstop/cli/commands.py 97.22% <0.00%> (-0.31%) :arrow_down:

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 fba23e8...bd03f56. Read the comment docs.