mambax7/xfaq

View on GitHub

Showing 36 of 48 total issues

Method xfaq_search has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function xfaq_search($queryarray, $andor, $limit, $offset, $userid)
{
    global $xoopsDB;

    global $xoopsDB;
Severity: Minor
Found in include/search.inc.php - About 1 hr to fix

    Method xfaq_tag_iteminfo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function xfaq_tag_iteminfo(&$items)
    {
        if (empty($items) || !is_array($items)) {
            return false;
        }
    Severity: Minor
    Found in extra/tag/xfaq.php - About 1 hr to fix

      Function getList has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getList($criteria = null, $limit = 0, $start = 0)
          {
              $ret = [];
              if ($criteria == null) {
                  $criteria = new CriteriaCompo();
      Severity: Minor
      Found in class/object.php - About 55 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 updateAll has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function updateAll($fieldname, $fieldvalue, $criteria = null, $force = false)
          {
              $set_clause = $fieldname . ' = ';
              if (is_numeric($fieldvalue)) {
                  $set_clause .= $fieldvalue;
      Severity: Minor
      Found in class/object.php - About 45 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

      Method addItem has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function addItem($id, $link = '', $icon = '', $name = '', $extra = '', $alt = '')
      Severity: Minor
      Found in class/menu.php - About 45 mins to fix

        Function recurseCopy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function recurseCopy($src, $dst)
            {
                $dir = opendir($src);
                //    @mkdir($dst);
                while (false !== ($file = readdir($dir))) {
        Severity: Minor
        Found in class/utility.php - About 45 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

        Method xfaq_search has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function xfaq_search($queryarray, $andor, $limit, $offset, $userid)
        Severity: Minor
        Found in include/search.inc.php - About 35 mins to fix

          Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function __construct(XoopsDatabase $db, $tablename, $classname, $keyname, $idenfierName = false)
          Severity: Minor
          Found in class/object.php - About 35 mins to fix

            Function b_xfaq_faq has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            function b_xfaq_faq($options)
            {
                require_once XOOPS_ROOT_PATH . '/modules/xfaq/class/faq.php';
                $myts = MyTextSanitizer::getInstance();
            
            
            Severity: Minor
            Found in blocks/blocks_faq.php - About 35 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 render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function render()
                {
                    $ret = "<div class=\"rmmenuicon\">";
                    foreach ($this->_items as $k => $v) {
                        $ret .= "<a href=\"" . $v['link'] . "\" title=\"" . ($v['alt'] != '' ? $v['alt'] : $v['name']) . "\">" . ($v['icon'] != '' ? "<img src=\"" . $v['icon'] . "\" alt=\"" . $v['name'] . "\"> " : '');
            Severity: Minor
            Found in class/menu.php - About 35 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 delete has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function delete($obj, $force = false)
                {
                    if (is_array($this->keyName)) {
                        $clause = [];
                        for ($i = 0, $iMax = count($this->keyName); $i < $iMax; ++$i) {
            Severity: Minor
            Found in class/object.php - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getForm($action = false)
                {
                    global $xoopsDB, $xoopsModuleConfig, $xoopsModule;
            
                    if ($action === false) {
            Severity: Minor
            Found in class/topic.php - About 35 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

            Avoid too many return statements within this method.
            Open

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

              Avoid too many return statements within this method.
              Open

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

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

                    public static function createFolder($folder)
                    {
                        //        try {
                        //            if (!mkdir($folder) && !is_dir($folder)) {
                        //                throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder));
                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 xoops_module_install_xfaq has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                function xoops_module_install_xfaq()
                {
                    global $xoopsModule, $xoopsConfig;
                
                    //Create directory /xfaq
                Severity: Minor
                Found in include/install.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