-
-
Notifications
You must be signed in to change notification settings - Fork 27
DeltaCode Scoring
A Delta object represents the file-level comparison (i.e., the "delta") of two codebases, typically two versions of the same codebase, using ScanCode-generated JSON output files as input for the comparison process.
Based on how the user constructs the command-line input, DeltaCode's naming convention treats one codebase as the "new" codebase and the other as the "old" codebase:
deltacode -n [path to the 'new' codebase] -o [path to the 'old' codebase] [...]
A DeltaCode codebase comparison produces a collection of file-level Delta objects. Depending on the nature of the file-level change between the two codebases, each Delta object is characterized as belonging to one of the categories listed below.
Each category has an associated score intended to convey its potential importance to a user's analysis of the changes between the new and old codebases. In descending order of importance, the categories are:
-
added: A file has been added to thenewcodebase. -
modified: The file is contained in both thenewandoldcodebase and has been modified. This modification is demonstrated among other things by a change in the file'ssha1attribute. -
moved: The file is contained in both thenewandoldcodebase and has not been modified but has been moved. -
removed: A file has been removed from theoldcodebase. -
unmodified: The file is contained in both thenewandoldcodebase and has not been modified or moved.
The score of a Delta object characterized as added or modified may be increased based on the detection of license- and/or copyright-related changes. See License Additions and Changes and Copyright Holder Additions and Changes below.
Each Delta object includes the following fields and values:
-
factors: One or more strings representing the factors that characterize the file-level comparison and resulting score, e.g.,
"factors": [
"added",
"license info added",
"copyright info added"
],
-
score: A number representing the magnitude/importance of the file-level change -- the higher thescore, the greater the change. -
new: The ScanCode-based file attributes (path,licenses,copyrightsetc.) for the file in the codebase designated by the user asnew. -
old: The ScanCode-based file attributes for the file in the codebase designated by the user asold.
Note that an added Delta object will have a new file but no old file, while a removed Delta object will have an old file but not a new file. In each case, the value for the missing file will be null.
Certain file-level changes involving the license-related information in a Delta object result in an increase in the object's score.
- For an
addedDelta object, if thenewfile contains one or more licenses(license info added), the object's score will be increased. - A
modifiedDelta object's score will be increased:- If the
oldfile had at least one license and thenewfile has no licenses (license info removed). - If the
oldfile had no licenses and thenewfile has at least one license (license info added). - If both the
oldandnewfile had at least one license and the license keys are not identical (e.g., theoldfile included anmitlicense and anapache-2.0license and thenewfile includes only anmitlicense) (license change).
- If the
- For both an
addedand amodifiedDelta object, the object's score will be increased if the thenewfile contains any of the following license categories:
'Commercial'
'Copyleft'
'Copyleft Limited'
'Free Restricted'
'Patent License'
'Proprietary Free'
[coming . . .]
[coming . . .]