Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Fix best match evaluation by taking pattern length into account during score calculation. #39

Merged
merged 1 commit into from
Oct 28, 2019

Conversation

tobias-richter
Copy link
Contributor

@tobias-richter tobias-richter commented Oct 28, 2019

Previously the score was calculated by using the machted group.length() only.
This can lead to wrong results with e.g.:

  • /.*\.domain\.tld/
  • /.*\.sub2\.sub1\.domain\.tld/

where sub3.sub2.sub1.domain.tld will match to /.*\.domain\.tld/ instead of /.*\.sub2\.sub1\.domain\.tld/

@tobias-richter tobias-richter changed the title Fix best match evaluation by taking pattern length into account. Fix best match evaluation by taking pattern length into account during score calculation. Oct 28, 2019
@codecov
Copy link

codecov bot commented Oct 28, 2019

Codecov Report

Merging #39 into master will increase coverage by 0.02%.
The diff coverage is 83.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #39      +/-   ##
============================================
+ Coverage      79.3%   79.33%   +0.02%     
  Complexity      361      361              
============================================
  Files            33       33              
  Lines           749      750       +1     
  Branches        163      163              
============================================
+ Hits            594      595       +1     
  Misses           43       43              
  Partials        112      112
Impacted Files Coverage Δ Complexity Δ
...evops/jenkins/pipeline/utils/PatternMatcher.groovy 93.33% <83.33%> (+0.47%) 2 <0> (ø) ⬇️

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 5d6164f...0c4aad9. Read the comment docs.

@tobias-richter tobias-richter merged commit e7f342d into master Oct 28, 2019
@tobias-richter tobias-richter deleted the feature/fix-pattern-matching branch October 28, 2019 12:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant