-
Notifications
You must be signed in to change notification settings - Fork 484
fix(readmeoss): added edited global license text in readmeoss #1486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fa6f236
to
4fcdb61
Compare
src/readmeoss/agent/readmeoss.php
Outdated
*/ | ||
function identifiedGlobalLicenses($contents) | ||
{ | ||
foreach ($contents["licensesMain"] as $key1 => $value1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$key1
and $value1
( and also $key2
and $value2
later) are very generic name and should be replaced
src/readmeoss/agent/readmeoss.php
Outdated
function identifiedGlobalLicenses($contents) | ||
{ | ||
foreach ($contents["licensesMain"] as $key1 => $value1) { | ||
$flag = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$flag
is a very generic name, and should be replaced by a more descriptive one
src/readmeoss/agent/readmeoss.php
Outdated
* @param[int,out] array $contents | ||
* @return array $contents with identified global license path | ||
*/ | ||
function identifiedGlobalLicenses($contents) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$contents
is a very generic variable name
src/readmeoss/agent/readmeoss.php
Outdated
} | ||
|
||
$contents = array('licensesMain'=>$licenseStmtsMain, 'licenses'=>$licenseStmts, 'copyrights'=>$copyrightStmts, 'licenseAcknowledgements' => $licenseAcknowledgements); | ||
$contents = $this->identifiedGlobalLicenses($contents); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is not very readable and it mutates $contents
, maybe add a new variable for the result with a descriptive name.
src/readmeoss/agent/readmeoss.php
Outdated
if ($ret !== FALSE) { | ||
$flag = 1; | ||
$mainLicenses[] = $value2; | ||
unset( $contents["licenses"][$key2]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unset( $contents["licenses"][$key2]); | |
unset($contents["licenses"][$key2]); |
src/readmeoss/agent/readmeoss.php
Outdated
* @param[int,out] array $contents | ||
* @return array $contents with identified global license path | ||
*/ | ||
function identifiedGlobalLicenses($contents) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name is not very descriptive. And I do not understand its functionality from the name or from the description.
src/readmeoss/agent/readmeoss.php
Outdated
foreach ($contents["licensesMain"] as $key1 => $value1) { | ||
$flag = 0; | ||
foreach ($contents["licenses"] as $key2 => $value2) { | ||
$ret = array_search($value1['licenseId'], $value2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ret
is a very generic variable name, why not use a descriptive one?
4fcdb61
to
f25b6df
Compare
Signed-off-by: Anupam Ghosh <[email protected]>
f25b6df
to
1045cf4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test works as expected, just adding a global license and it is shown in the report like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good
Description
Edited global Licenses are not appearing in the Main Licenses section of the readmeoss report
How to test