mambax7/publisher

View on GitHub

Showing 355 of 3,032 total issues

Avoid too many return statements within this method.
Open

            return 'DESC';
Severity: Major
Found in class/Utility.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

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

      Avoid too many return statements within this method.
      Open

                  return 'DESC';
      Severity: Major
      Found in class/Utility.php - About 30 mins to fix

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

        function handleResponse() {
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200) {
        
                    var response = xmlhttp.responseText;
        Severity: Minor
        Found in assets/js/rating.js - 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 getObjects has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function &getObjects($criteria = null, $idAsKey = false, $asObject = true) //&getObjects($criteria = null, $idAsKey = false)
            {
                $ret   = [];
                $limit = $start = 0;
                $sql   = $this->selectQuery($criteria);
        Severity: Minor
        Found in class/BaseObjectHandler.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 notNullFieldClause has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function notNullFieldClause($notNullFields = '', $withAnd = false)
            {
                $ret = '';
                if ($withAnd) {
                    $ret .= ' AND ';
        Severity: Minor
        Found in class/ItemHandler.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 getOrderBy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getOrderBy($sort)
            {
                if ('datesub' === $sort) {
                    return 'DESC';
                }
        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 convertIPAddresses has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private function convertIPAddresses($tableName, $columnName): void
            {
                if ($this->tableHandler->useTable($tableName)) {
                    $attributes = $this->tableHandler->getColumnAttributes($tableName, $columnName);
                    if (false !== \mb_strpos($attributes, ' int(')) {
        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 getPathStatus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getPathStatus($item, $getStatus = false)
            {
                $path = '';
                if ('root' !== $item) {
                    $path = $item;
        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 editFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function editFile($showmenu = false, $fileid = 0, $itemId = 0): void
            {
                $helper = Helper::getInstance();
                require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
        
        
        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 sendNotifications has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function sendNotifications($notifications = []): void
            {
                /** @var \XoopsNotificationHandler $notificationHandler */
                $notificationHandler = \xoops_getHandler('notification');
                $tags                = [];
        Severity: Minor
        Found in class/Item.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 selectQuery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private function selectQuery($criteria = null, $join = false)
            {
                //        if (!$join) {
                //            $sql = sprintf('SELECT * FROM `%s`', $this->db->prefix($this->dbtable));
                //        } else {
        Severity: Minor
        Found in class/MimetypeHandler.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 getTitle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getTitle($maxLength = 0, $format = 'S')
            {
                $ret = $this->getVar('title', $format);
                if (0 != $maxLength) {
                    if (!XOOPS_USE_MULTIBYTES) {
        Severity: Minor
        Found in class/Item.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 getSubtitle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getSubtitle($maxLength = 0, $format = 'S')
            {
                $ret = $this->getVar('subtitle', $format);
                if (0 != $maxLength) {
                    if (!XOOPS_USE_MULTIBYTES) {
        Severity: Minor
        Found in class/Item.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

        Severity
        Category
        Status
        Source
        Language