mambax7/adslight

View on GitHub

Showing 573 of 5,122 total issues

Avoid too many return statements within this function.
Open

            return 0;
Severity: Major
Found in assets/js/tablesorter/js/jquery.tablesorter.combined.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                        return $.trim( tmp( $node[ 0 ], c.table, cellIndex ) );
    Severity: Major
    Found in assets/js/tablesorter/js/jquery.tablesorter.js - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return true;
      Severity: Major
      Found in class/PicturesHandler.php - About 30 mins to fix

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

        function tips_writing(): void
        {
            global $xoopsDB, $xoopsConfig, $xoopsModule, $xoopsTpl, $myts, $mytree, $meta, $mid, $prem_perm;
            $helper                                  = Helper::getInstance();
            $GLOBALS['xoopsOption']['template_main'] = 'adslight_tips_writing_ad.tpl';
        Severity: Minor
        Found in tips_writing_ad.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(): void
        {
            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 renameColumns has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private function renameColumns(): void
            {
                $tables = new Tables();
                foreach ($this->renameColumns as $table) {
                    $tableName   = $table['tablename'];
        Severity: Minor
        Found in class/Common/Migrate.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 getChildTreeArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getChildTreeArray($sel_id = 0, $order = '', $parray = [], $r_prefix = ''): array
            {
                $sql = 'SELECT SQL_CACHE * FROM ' . $this->table . ' WHERE ' . $this->pid . '=' . $sel_id;
        
                $categories = Utility::getMyItemIds('adslight_view');
        Severity: Minor
        Found in class/Tree.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 getAllChild has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getAllChild($sel_id = 0, $order = '', $parray = []): array
            {
                $sql = 'SELECT SQL_CACHE * FROM ' . $this->table . ' WHERE ' . $this->pid . '=' . $sel_id;
        
                $categories = Utility::getMyItemIds('adslight_view');
        Severity: Minor
        Found in class/Tree.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 cloneRecord has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function cloneRecord(string $tableName, string $idField, int $id): ?int
            {
                $newId     = null;
                $tempTable = '';
                $table     = $GLOBALS['xoopsDB']->prefix($tableName);
        Severity: Minor
        Found in class/Common/SysUtility.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 getAllChildId has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getAllChildId($sel_id, $order = '', $idarray = []): array
            {
                $sel_id = (int)$sel_id;
                $sql    = 'SELECT SQL_CACHE ' . $this->id . ' FROM ' . $this->table . ' WHERE ' . $this->pid . '=' . $sel_id;
        
        
        Severity: Minor
        Found in class/Tree.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 getFirstChild has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getFirstChild($sel_id, $order = ''): array
            {
                $arr = [];
                $sql = 'SELECT SQL_CACHE * FROM ' . $this->table . ' WHERE ' . $this->pid . '=' . $sel_id . ' ';
        
        
        Severity: Minor
        Found in class/Tree.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 getChildTreeMapArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getChildTreeMapArray($sel_id = 0, $order = '', $parray = [], $r_prefix = ''): array
            {
                global $xoopsDB;
                $sql = 'SELECT SQL_CACHE * FROM ' . $this->table . ' WHERE ' . $this->pid . '=' . $sel_id . ' ';
        
        
        Severity: Minor
        Found in class/Tree.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 adslightMaps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function adslightMaps(): void
        {
            global $xoopsDB, $xoopsConfig, $xoopsModule, $myts, $prem_perm;
        
            $GLOBALS['xoopsOption']['template_main'] = 'adslight_maps.tpl';
        Severity: Minor
        Found in maps.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