Skip to content
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

Few weaknesses in the code #6715

Closed
AppChecker opened this issue Sep 22, 2016 · 5 comments
Closed

Few weaknesses in the code #6715

AppChecker opened this issue Sep 22, 2016 · 5 comments
Assignees
Labels
bug report Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@AppChecker
Copy link

Hi!

I hope this will be helpful:

app/code/Magento/Usps/Model/Carrier.php

        if ($response === false || $response->getName() == 'Error') {
            $debugData['result'] = [
                'error' => $response->Description,
                'code' => $response->Number,
                'xml' => $response->asXML(),
            ];
...
        }

if $response is false, method asXML will be called on false

app/code/Magento/CatalogSearch/Model/Layer/Filter/Decimal.php

$label = $this->renderRangeLabel(
                empty($from) ? 0 : $from,
                empty($to) ? $to : $to
            );

Both parts of ternary operators are equals.

app/code/Magento/CatalogRule/Model/Rule.php

if (is_array($value)) {
                    if ($value != $array2[$key]) {
                        $result[$key] = true;
                    }
                } else {
                    if ($value != $array2[$key]) {
                        $result[$key] = true;
                    }
                }

Parts of if-conditional operator are equals.

Possible defect was found by Echelon team with AppChecker static analyzer

@veloraven
Copy link
Contributor

veloraven commented Sep 23, 2016

@AppChecker thank you for your feedback.
Please identify which version of Magento you are running.
Please create a separate issue for each problem and format them according to the Issue reporting guidelines

@veloraven veloraven self-assigned this Oct 20, 2016
@AppChecker AppChecker mentioned this issue Dec 13, 2016
@vzabaznov vzabaznov added bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development and removed Progress: needs update labels Dec 13, 2016
@vzabaznov
Copy link
Contributor

internal ticket created MAGETWO-62187

@vzabaznov
Copy link
Contributor

issue was fixed in fresh magento, thanks for reporting

@magento-engcom-team
Copy link
Contributor

Hi @AppChecker. Thank you for your report.
The issue has been fixed in #21968 by @Nazar65 in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.2 release.

@magento-engcom-team magento-engcom-team added Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Apr 20, 2019
@magento-engcom-team
Copy link
Contributor

Hi @AppChecker. Thank you for your report.
The issue has been fixed in #22453 by @Nazar65 in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.9 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Apr 23, 2019
mmansoor-magento pushed a commit that referenced this issue Aug 10, 2021
…ync-032221

Sync of 2.4.3-develop with 2.4-develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

4 participants