mambax7/smartfaq

View on GitHub

Showing 374 of 649 total issues

Function olMain has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function olMain() {
    var layerhtml, styleType;
    runHook("olMain", FBEFORE);

    if (o3_background != "" || o3_fullhtml) {
Severity: Minor
Found in assets/js/overlib/overlib.js - About 1 hr to fix

    Method xoops_module_update_smartfaq has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function xoops_module_update_smartfaq($module)
    {
        /*
        // Load SmartDbUpdater from the SmartObject Framework if present
        $smartdbupdater = XOOPS_ROOT_PATH . '/modules/smartobject/class/smartdbupdater.php';
    Severity: Minor
    Found in include/onupdate.inc.php - About 1 hr to fix

      Function olMain has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function olMain() {
          var layerhtml, styleType;
          runHook("olMain", FBEFORE);
          if (o3_background != "" || o3_fullhtml) {
              layerhtml = runHook('ol_content_background', FALTERNATE, o3_css, o3_text, o3_background, o3_fullhtml);
      Severity: Minor
      Found in assets/js/overlib/mini/overlib_mini.js - About 1 hr to fix

        Method checkVerModule has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function checkVerModule(Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
            {
                $moduleDirName      = \basename(\dirname(__DIR__, 2));
                $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                $update             = '';
        Severity: Minor
        Found in class/Common/VersionChecks.php - About 1 hr to fix

          Method updateBlock has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups)
              : void {
                  $myblock = new \XoopsBlock($bid);
                  $myblock->setVar('title', $btitle);
                  $myblock->setVar('weight', $bweight);
          Severity: Minor
          Found in class/Common/Blocksadmin.php - About 1 hr to fix

            Method insert has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function insert(\XoopsObject $object, $force = false)
                {
                    if ('xoopsmodules\smartfaq\category' !== \mb_strtolower(\get_class($object))) {
                        return false;
                    }
            Severity: Minor
            Found in class/CategoryHandler.php - About 1 hr to fix

              Method getFaqsCount has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getFaqsCount($categoryid = -1, $status = '', $notNullFields = '')
                  {
                      global $xoopsUser;
              
                      //  if ( ($categoryid = -1) && (empty($status) || ($status == -1)) ) {
              Severity: Minor
              Found in class/FaqHandler.php - About 1 hr to fix

                Method getObjects has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getObjects(\CriteriaElement $criteria = null, $id_as_key = false, $notNullFields = '')
                    {
                        $ret   = [];
                        $limit = $start = 0;
                        $sql   = 'SELECT * FROM ' . $this->db->prefix('smartfaq_faq');
                Severity: Minor
                Found in class/FaqHandler.php - About 1 hr to fix

                  Method collapsableBar has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function collapsableBar($tablename = '', $iconname = ''): void
                      {
                          ?>
                          <script type="text/javascript"><!--
                              function goto_URL(object) {
                  Severity: Minor
                  Found in class/Utility.php - About 1 hr to fix

                    Function getRefById has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function getRefById(l, d) {
                        var r = "", j
                        d = (d || document)
                        if (d.all) return d.all[l]
                        else if (d.getElementById) return d.getElementById(l)
                    Severity: Minor
                    Found in assets/js/overlib/mini/overlib_anchor_mini.js - About 1 hr 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 getRefById has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function getRefById(l, d) {
                        var r = "", j
                    
                        d = (d || document)
                        if (d.all) return d.all[l]
                    Severity: Minor
                    Found in assets/js/overlib/overlib_anchor.js - About 1 hr 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 loadTableFromArrayWithReplace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function loadTableFromArrayWithReplace($table, $data, $search, $replace)
                    {
                        /** @var \XoopsMySQLDatabase $db */
                        $db = \XoopsDatabaseFactory::getDatabaseConnection();
                    
                    
                    Severity: Minor
                    Found in testdata/index.php - About 1 hr 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 getFaqsCount has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getFaqsCount($categoryid = -1, $status = '', $notNullFields = '')
                        {
                            global $xoopsUser;
                    
                            //  if ( ($categoryid = -1) && (empty($status) || ($status == -1)) ) {
                    Severity: Minor
                    Found in class/FaqHandler.php - About 1 hr 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 displayCategory has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function displayCategory($categoryObj, $level = 0): void
                    {
                        global $xoopsModule, $categoryHandler, $pathIcon16;
                        $description = $categoryObj->description();
                        if (!XOOPS_USE_MULTIBYTES) {
                    Severity: Minor
                    Found in admin/category.php - About 1 hr to fix

                      Method orderBlock has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function orderBlock(
                              array $bid,
                              array $oldtitle,
                              array $oldside,
                              array $oldweight,
                      Severity: Minor
                      Found in class/Common/Blocksadmin.php - About 1 hr to fix

                        Method makeMySelBox has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = ''): void
                            {
                                if ('' === $sel_name) {
                                    $sel_name = $this->id;
                                }
                        Severity: Minor
                        Found in class/Tree.php - About 1 hr to fix

                          Function getRefByName has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function getRefByName(l, d) {
                              var r = null, j
                              d = (d || document)
                              if (d.images[l]) return d.images[l]
                              else if (d.anchors[l]) return d.anchors[l]; else if (d.layers && d.layers.length > 0) {
                          Severity: Minor
                          Found in assets/js/overlib/mini/overlib_anchor_mini.js - About 1 hr 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 getAnchorLocation has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function getAnchorLocation(objRef) {
                              var mkObj, of, offsets, mlyr
                              mkObj = mlyr = objRef
                              offsets = [o3_anchorx, o3_anchory]
                              if (document.layers) {
                          Severity: Minor
                          Found in assets/js/overlib/mini/overlib_anchor_mini.js - About 1 hr 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 b_faqs_recent_show has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function b_faqs_recent_show($options)
                          {
                              //    require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
                              $myts = \MyTextSanitizer::getInstance();
                          
                          
                          Severity: Minor
                          Found in blocks/faqs_recent.php - About 1 hr 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 getAnchorLocation has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function getAnchorLocation(objRef) {
                              var mkObj, of, offsets, mlyr
                          
                              mkObj = mlyr = objRef
                              offsets = [o3_anchorx, o3_anchory]
                          Severity: Minor
                          Found in assets/js/overlib/overlib_anchor.js - About 1 hr 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