mambax7 /
adslight
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | /* |
||
| 3 | ------------------------------------------------------------------------- |
||
| 4 | ADSLIGHT 2 : Module for Xoops |
||
| 5 | |||
| 6 | Redesigned and ameliorate By Luc Bizet user at www.frxoops.org |
||
| 7 | Started with the Classifieds module and made MANY changes |
||
| 8 | Website : http://www.luc-bizet.fr |
||
| 9 | Contact : [email protected] |
||
| 10 | ------------------------------------------------------------------------- |
||
| 11 | Original credits below Version History |
||
| 12 | ########################################################################## |
||
| 13 | # Classified Module for Xoops # |
||
| 14 | # By John Mordo user jlm69 at www.xoops.org and www.jlmzone.com # |
||
| 15 | # Started with the MyAds module and made MANY changes # |
||
| 16 | ########################################################################## |
||
| 17 | Original Author: Pascal Le Boustouller |
||
| 18 | Author Website : [email protected] |
||
| 19 | Licence Type : GPL |
||
| 20 | ------------------------------------------------------------------------- |
||
| 21 | */ |
||
| 22 | ///////////////////////////////////// |
||
|
0 ignored issues
–
show
|
|||
| 23 | // AdsLight UrlRewrite By Nikita // |
||
| 24 | // http://www.aideordi.com // |
||
| 25 | ///////////////////////////////////// |
||
| 26 | |||
| 27 | include dirname(dirname(__DIR__)) . '/mainfile.php'; |
||
| 28 | global $xoopsModuleConfig; |
||
|
1 ignored issue
–
show
Compatibility
Best Practice
introduced
by
Use of
global functionality is not recommended; it makes your code harder to test, and less reusable.
Instead of relying on 1. Pass all data via parametersfunction myFunction($a, $b) {
// Do something
}
2. Create a class that maintains your stateclass MyClass {
private $a;
private $b;
public function __construct($a, $b) {
$this->a = $a;
$this->b = $b;
}
public function myFunction() {
// Do something
}
}
Loading history...
|
|||
| 29 | |||
| 30 | if ($xoopsModuleConfig["active_rewriteurl"] > 0) { |
||
| 31 | include_once __DIR__ . '/seo_url.php'; |
||
| 32 | } |
||
| 33 | |||
| 34 | $myts =& MyTextSanitizer::getInstance(); |
||
| 35 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.