mambax7/smartfaq

View on GitHub

Showing 374 of 649 total issues

Consider simplifying this complex logical expression.
Open

    if (typeof o3_scroll != 'undefined' && o3_scroll && o3_sticky && (o3_relx || o3_rely) && (typeof o3_draggable == 'undefined' || !o3_draggable)) {
        if (typeof over.scroller == 'undefined' || over.scroller.canScroll) over.scroller = new scroller(placeX - winoffset, placeY - scrolloffset, setTimeout("repositionOver()", 20));
    }
Severity: Major
Found in assets/js/overlib/overlib_anchor.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

        if (!olIe4 || olOp || !olIe55 || (typeof o3_shadow != 'undefined' && o3_shadow) || (typeof o3_bubble != 'undefined' && o3_bubble)) return;
    Severity: Major
    Found in assets/js/overlib/overlib_hideform.js - About 1 hr to fix

      Method getFaqsAdminSide has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $limit = 0,
              $start = 0,
              $status = '',
              $categoryid = -1,
              $sort = 'datesub',
      Severity: Major
      Found in class/FaqHandler.php - About 1 hr to fix

        Method isBlockCloned has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function isBlockCloned(int $bid, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
        Severity: Major
        Found in class/Common/Blocksadmin.php - About 1 hr to fix

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

          function overlib() {
              if (!olLoaded || isExclusive(overlib.arguments)) return true;
              if (olCheckMouseCapture) olMouseCapture();
              if (over) cClick();
          
          
          Severity: Minor
          Found in assets/js/overlib/overlib.js - 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 olMouseCapture has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          function olMouseCapture() {
              capExtent = document;
              var fN, mseHandler = olMouseMove;
              var re = /function[ ]+(\w+)\(/;
          
          
          Severity: Minor
          Found in assets/js/overlib/overlib.js - 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 opt_NOCLOSE has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          function opt_NOCLOSE(unused) {
              if (!unused) o3_close = "";
          
              if (olNs4) {
                  over.captureEvents(Event.MOUSEOUT || Event.MOUSEOVER);
          Severity: Minor
          Found in assets/js/overlib/overlib.js - 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 olMouseCapture has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          function olMouseCapture() {
              capExtent = document;
              var fN, mseHandler = olMouseMove;
              var re = /function[ ]+(\w+)\(/;
              if (document.onmousemove || (!olIe4 && window.onmousemove)) {
          Severity: Minor
          Found in assets/js/overlib/mini/overlib_mini.js - 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 createPopup has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          function createPopup(lyrContent) {
              runHook("createPopup", FBEFORE);
          
              if (o3_wrap && !(olNs4 || olOp)) {
                  if (olIe4) {
          Severity: Minor
          Found in assets/js/overlib/overlib.js - 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 opt_NOCLOSE has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          function opt_NOCLOSE(unused) {
              if (!unused) o3_close = "";
              if (olNs4) {
                  over.captureEvents(Event.MOUSEOUT || Event.MOUSEOVER);
                  over.onmouseover = function () {
          Severity: Minor
          Found in assets/js/overlib/mini/overlib_mini.js - 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 overlib has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          function overlib() {
              if (!olLoaded || isExclusive(overlib.arguments)) return true;
              if (olCheckMouseCapture) olMouseCapture();
              if (over) cClick();
              o3_text = ol_text;
          Severity: Minor
          Found in assets/js/overlib/mini/overlib_mini.js - 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 createPopup has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          function createPopup(lyrContent) {
              runHook("createPopup", FBEFORE);
              if (o3_wrap && !(olNs4 || olOp)) {
                  if (olIe4) {
                      over.style.pixelWidth = 0;
          Severity: Minor
          Found in assets/js/overlib/mini/overlib_mini.js - 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 rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function rcopy($src, $dest)
              {
                  // Only continue if user is a 'global' Admin
                  if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                      return false;
          Severity: Minor
          Found in class/Common/FilesManagement.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 recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function recurseCopy($src, $dst): void
              {
                  $dir = \opendir($src);
                  //        @mkdir($dst);
                  if (!@\mkdir($dst) && !\is_dir($dst)) {
          Severity: Minor
          Found in class/Common/FilesManagement.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 rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function rmove($src, $dest)
              {
                  // Only continue if user is a 'global' Admin
                  if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                      return false;
          Severity: Minor
          Found in class/Common/FilesManagement.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 getFaqsAdminSide has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getFaqsAdminSide(
                  $limit = 0,
                  $start = 0,
                  $status = '',
                  $categoryid = -1,
          Severity: Minor
          Found in class/FaqHandler.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 getCategoriesWithOpenQuestion has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function &getCategoriesWithOpenQuestion(
                  $limit = 0,
                  $start = 0,
                  $parentid = 0,
                  $sort = 'weight',
          Severity: Minor
          Found in class/CategoryHandler.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 render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function render()
              {
                  $ret = '';
          
                  if (\count($this->_appendix) > 0) {
          Severity: Minor
          Found in class/GroupFormCheckBox.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 __construct has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function __construct($uploadDir, $allowedMimeTypes = 0, $maxFileSize = 0, $maxWidth = 0, $maxHeight = 0)
              {
                  if (!\is_array($allowedMimeTypes)) {
                      if (empty($allowedMimeTypes) || '*' === $allowedMimeTypes) {
                          $allowedMimeTypes = [];
          Severity: Minor
          Found in class/Uploader.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

          Method setOrder has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function setOrder(string $bid, string $title, string $weight, string $visible, string $side, string $bcachetime, ?array $bmodule = null)
          Severity: Major
          Found in class/Common/Blocksadmin.php - About 50 mins to fix
            Severity
            Category
            Status
            Source
            Language