XoopsModules25x/xlanguage

View on GitHub

Showing 589 of 589 total issues

Expected 1 blank line at end of file; 2 found
Open

}

There must be one USE keyword per declaration
Open

use XoopsModules\Xlanguage\{Common
Severity: Minor
Found in class/Utility.php by phpcodesniffer

There must be one blank line after the last USE statement; 13 found;
Open

use XoopsObject;
Severity: Minor
Found in class/Blanguage.php by phpcodesniffer

Missing class import via use statement (line '54', column '24').
Open

        $dirInfo = new \SplFileInfo($old_dir);
Severity: Minor
Found in include/onuninstall.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid too many return statements within this method.
Open

        return $lang->getVar('lang_id');
Severity: Major
Found in class/LanguageHandler.php - About 30 mins to fix

    The method getByName has a boolean flag argument $isBase, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getByName($name, $isBase = false)
    Severity: Minor
    Found in class/LanguageHandler.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method __construct has a boolean flag argument $isBase, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function __construct($isBase = false)
    Severity: Minor
    Found in class/Blanguage.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Missing class import via use statement (line '126', column '24').
    Open

        $criteria->add(new \Criteria('gperm_modid', $helper->getModule()->getVar('mid')));
    Severity: Minor
    Found in testdata/index.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method truncateHtml has a boolean flag argument $exact, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
    Severity: Minor
    Found in class/Common/SysUtility.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Missing class import via use statement (line '125', column '21').
    Open

        $criteria = new \CriteriaCompo();
    Severity: Minor
    Found in testdata/index.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method create has a boolean flag argument $isBase, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function create($isNew = true, $isBase = true)
    Severity: Minor
    Found in class/LanguageHandler.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Missing class import via use statement (line '76', column '45').
    Open

                                $fileInfo = new \SplFileInfo($templateFolder . $v);
    Severity: Minor
    Found in include/onupdate.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method getAll has a boolean flag argument $isBase, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getAll($isBase = true)
    Severity: Minor
    Found in class/LanguageHandler.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Remove error control operator '@' on line 68.
    Open

        public static function recurseCopy($src, $dst)
        {
            $dir = \opendir($src);
            //        @mkdir($dst);
            if (!@\mkdir($dst) && !\is_dir($dst)) {
    Severity: Minor
    Found in class/Common/FilesManagement.php by phpmd

    ErrorControlOperator

    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

    Example

    function foo($filePath) {
        $file = @fopen($filPath); // hides exceptions
        $key = @$array[$notExistingKey]; // assigns null to $key
    }

    Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

    The method truncateHtml has a boolean flag argument $considerHtml, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
    Severity: Minor
    Found in class/Common/SysUtility.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method getInstance has a boolean flag argument $debug, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function getInstance($debug = false)
    Severity: Minor
    Found in class/Helper.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method get has a boolean flag argument $isBase, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function get($id, $isBase = true)
    Severity: Minor
    Found in class/LanguageHandler.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method __construct has a boolean flag argument $isBase, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function __construct($isBase = false)
    Severity: Minor
    Found in class/Language.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method create has a boolean flag argument $isNew, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function create($isNew = true, $isBase = true)
    Severity: Minor
    Found in class/LanguageHandler.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Missing class import via use statement (line '188', column '31').
    Open

                $descEditor = new \XoopsFormDhtmlTextArea(\ucfirst($options['name']), $options['name'], $options['value'], 5, 50);
    Severity: Minor
    Found in class/Common/SysUtility.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Severity
    Category
    Status
    Source
    Language