mambax7/tdmdownloads

View on GitHub

Showing 130 of 207 total issues

Avoid too many return statements within this method.
Open

            return false;
Severity: Major
Found in class/Common/ImageResizer.php - About 30 mins to fix

    Function getForm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getForm($action = false)
        {
            $helper        = Helper::getInstance();
            $moduleDirName = \basename(\dirname(__DIR__));
            if (!$action) {
    Severity: Minor
    Found in class/Field.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function getForm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getForm($action = false)
        {
            $helper = Helper::getInstance();
            if (!$action) {
                $action = $_SERVER['REQUEST_URI'];
    Severity: Minor
    Found in class/Category.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function convertFileSize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function convertFileSize($size)
        {
            if ($size > 0) {
                $kb = 1024;
                $mb = 1024 * 1024;
    Severity: Minor
    Found in class/Utility.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function getPopularImage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getPopularImage($hits)
        {
            global $xoopsModuleConfig;
            $moduleDirName = \basename(\dirname(__DIR__));
            $pop           = '';
    Severity: Minor
    Found in class/Utility.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function convertStringToSize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function convertStringToSize($stringSize)
        {
            if ('' != $stringSize) {
                $kb             = 1024;
                $mb             = 1024 * 1024;
    Severity: Minor
    Found in class/Utility.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function createLogo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function createLogo($dirname)
        {
            if (!\extension_loaded('gd')) {
                return false;
            }
    Severity: Minor
    Found in class/Cloner.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function loadSampleData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    function loadSampleData()
    {
        global $xoopsConfig;
        $moduleDirName      = \basename(\dirname(__DIR__));
        $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
    Severity: Minor
    Found in testdata/index.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function getPopularImage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getPopularImage($hits)
        {
            $helper        = Helper::getInstance();
            $moduleDirName = \basename(\dirname(__DIR__));
            $pop           = '';
    Severity: Minor
    Found in class/Utilities.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function cleanVars has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function cleanVars($global, $key, $default = '', $type = 'int')
        {
            switch ($type) {
                case 'string':
                    if (\defined('FILTER_SANITIZE_ADD_SLASHES')) {
    Severity: Minor
    Found in class/Utilities.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Severity
    Category
    Status
    Source
    Language