scorecard icon indicating copy to clipboard operation
scorecard copied to clipboard

:seedling: Combine hasLicenseFile and hasLicenseFileAtTopDir probes

Open spencerschrock opened this issue 1 year ago • 3 comments

What kind of change does this PR introduce?

probe cleanup

What is the current behavior?

There are 3 license probes, but 2 of them (hasLicenseFile and hasLicenseFileAtTopDir) always exhibit the same positive/negative behavior so there are effectively only 2 license probes.

What is the new behavior (if this is a feature change)?**

  • hasLicenseFileAtTopDir is deleted
  • ensure license findings use the license file locations
  • finding logging is simplified using the standard checker.LogFindings function
    • since hasFSFOrOSIApprovedLicense can sometimes return OutcomeNotApplicable, this converts one message to a DEBUG message. But its identical to the WARN message already produced by hasLicenseFile.
before:
"details": [
        "Info: project does not have a license file",
        "Info: project does not have a license file"
      ],
after:
  "details": [
        "Warn: project does not have a license file",
        "Debug: project does not have a license file"
      ],
  • [X] Tests for the changes have been added (for bug fixes/features)

Tests modified at least

Which issue(s) this PR fixes

Fixes #3590

Special notes for your reviewer

Does this PR introduce a user-facing change?

For user-facing changes, please add a concise, human-readable release note to the release-note

(In particular, describe what changes users might need to make in their application as a result of this pull request.)

Reduced duplicate logging messages related to License details.

spencerschrock avatar Mar 19 '24 23:03 spencerschrock

Codecov Report

Merging #3955 (9118bb8) into main (be15709) will increase coverage by 1.87%. The diff coverage is 82.35%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3955      +/-   ##
==========================================
+ Coverage   66.77%   68.65%   +1.87%     
==========================================
  Files         227      226       -1     
  Lines       16249    16147     -102     
==========================================
+ Hits        10851    11085     +234     
+ Misses       4729     4360     -369     
- Partials      669      702      +33     

codecov[bot] avatar Mar 19 '24 23:03 codecov[bot]

/scdiff generate License

spencerschrock avatar Mar 20 '24 17:03 spencerschrock