-
-
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.
Depending 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. For purposes of assigning a score to the Delta object, an object can be characterized as follows:
-
added: A file has been added to thenewcodebase`.- The inclusion of license and/or copyright information in an
addedDelta will increase the object's score. See License Additions and Changes and Copyright Holder Additions and Changes below.
- The inclusion of license and/or copyright information in an
-
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.- Certain changes to the license and/or copyright information in a
modifiedDelta will increase the object's score. See License Additions and Changes and Copyright Holder Additions and Changes below.
- Certain changes to the license and/or copyright information in a
-
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.
As discussed below, each of these categories is assigned a score intended to convey its potential importance to a user's analysis of the changes between the new and old codebases. Where the Delta object is added or modified
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 (if any)* in the codebase designated by the user asnew. -
old: The ScanCode-based file attributes for the file (if any)* in the codebase designated by the user asold.
Each Delta object will always have a new or an old file and often will have both. For example:
-
addedandremoved: If a file has been added to thenewcodebase, the Delta object will contain the file attributes for thenewfile. Since the file has been added, there is therefore no corresponding file in theoldcodebase, and the Delta object's value for theoldfile will benull. Where a file has been removed from theoldcodebase, the Delta object will contain the file attributes for theoldfile and the value for thenewfile will benull. -
modified,movedandunmodified: [coming . . .]
[coming . . .]
[coming . . .]
[coming . . .]