mambax7/smartfaq

View on GitHub

Showing 374 of 649 total issues

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

function opt_MULTIPLEARGS(i, args, parameter) {
    var k = i, l, re, pV, str = '';
    for (k = i; k < args.length; k++) {
        str += args[k] + ',';
        if (typeof args[k] == 'number' && args[k] > pmStart) break;
Severity: Minor
Found in assets/js/overlib/mini/overlib_mini.js - 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 layerWrite has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function layerWrite(txt) {
    txt += "\n";
    if (olNs4) {
        var lyr = o3_frame.document.overDiv.document
        lyr.write(txt)
Severity: Minor
Found in assets/js/overlib/overlib.js - 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 disp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function disp(statustext) {
    runHook("disp", FBEFORE);

    if (o3_allowmove == 0) {
        runHook("placeLayer", FREPLACE);
Severity: Minor
Found in assets/js/overlib/overlib.js - 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 isFunction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function isFunction(fnRef) {
    var rtn = true;

    if (typeof fnRef == 'object') {
        for (var i = 0; i < fnRef.length; i++) {
Severity: Minor
Found in assets/js/overlib/overlib.js - 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 parseFrameExtras has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function parseFrameExtras(pf, i, ar) {
    var k = i, v;

    if (k < ar.length) {
        if (ar[k] == FRAME) {
Severity: Minor
Found in assets/js/overlib/overlib_crossframe.js - 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 disp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function disp(statustext) {
    runHook("disp", FBEFORE);
    if (o3_allowmove == 0) {
        runHook("placeLayer", FREPLACE);
        (olNs6 && olShowId < 0) ? olShowId = setTimeout("runHook('showObject', FREPLACE, over)", 1) : runHook("showObject", FREPLACE, over);
Severity: Minor
Found in assets/js/overlib/mini/overlib_mini.js - 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 cleanUpShadowEffects has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function cleanUpShadowEffects() {
    if (olNs4) return;
    else {
        var dpObj = (olIe4 ? o3_frame.document.all['backdrop'] : o3_frame.document.getElementById('backdrop'));
        if (olIe4 && !isMac && dpObj.filters.Beta) dpObj.filters.Beta.enabled = false;
Severity: Minor
Found in assets/js/overlib/overlib_shadow.js - 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 parseFrameExtras has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function parseFrameExtras(pf, i, ar) {
    var k = i, v;
    if (k < ar.length) {
        if (ar[k] == FRAME) {
            v = ar[++k];
Severity: Minor
Found in assets/js/overlib/mini/overlib_crossframe_mini.js - 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 cleanUpShadowEffects has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function cleanUpShadowEffects() {
    if (olNs4) return; else {
        var dpObj = (olIe4 ? o3_frame.document.all['backdrop'] : o3_frame.document.getElementById('backdrop'));
        if (olIe4 && !isMac && dpObj.filters.Beta) dpObj.filters.Beta.enabled = false; else if (typeof(dpObj.style.MozOpacity) == 'string') dpObj.style.MozOpacity = 1.0;
    }
Severity: Minor
Found in assets/js/overlib/mini/overlib_shadow_mini.js - 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 layerWrite has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function layerWrite(txt) {
    txt += "\n";
    if (olNs4) {
        var lyr = o3_frame.document.overDiv.document
        lyr.write(txt)
Severity: Minor
Found in assets/js/overlib/mini/overlib_mini.js - 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 isFunction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function isFunction(fnRef) {
    var rtn = true;
    if (typeof fnRef == 'object') {
        for (var i = 0; i < fnRef.length; i++) {
            if (typeof fnRef[i] == 'function') continue;
Severity: Minor
Found in assets/js/overlib/mini/overlib_mini.js - 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 opt_MULTIPLEARGS has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function opt_MULTIPLEARGS(i, args, parameter) {
    var k = i, l, re, pV, str = '';

    for (k = i; k < args.length; k++) {
        str += args[k] + ',';
Severity: Minor
Found in assets/js/overlib/overlib.js - 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 getEditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getEditor($helper = null, $options = null)
    {
        /** @var Helper $helper */
        if (null === $options) {
            $options           = [];
Severity: Minor
Found in class/Common/SysUtility.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 xoops_module_update_smartfaq has a Cognitive Complexity of 7 (exceeds 5 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 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 __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($id = null)
    {
        $this->db = XoopsDatabaseFactory::getDatabaseConnection();
        $this->initVar('categoryid', \XOBJ_DTYPE_INT, null, false);
        $this->initVar('parentid', \XOBJ_DTYPE_INT, null, false);
Severity: Minor
Found in class/Category.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 toArray has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function toArray($faq = [], $category = null, $linkInQuestion = true)
    {
        /** @var Smartfaq\Helper $helper */
        $helper = Smartfaq\Helper::getInstance();

Severity: Minor
Found in class/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 renderOptionTree has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function renderOptionTree(&$tree, $option, $prefix, $parentIds = []): void
    {
        $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="';
        // If there are parent elements, add javascript that will
        // make them selecteded when this element is checked to make
Severity: Minor
Found in class/GroupFormCheckBox.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 __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($id = null)
    {
        $this->db = \XoopsDatabaseFactory::getDatabaseConnection();
        $this->initVar('answerid', \XOBJ_DTYPE_INT, null, false);
        $this->initVar('status', \XOBJ_DTYPE_INT, -1, false);
Severity: Minor
Found in class/Answer.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 function.
Open

            return k;
Severity: Major
Found in assets/js/overlib/mini/overlib_cssstyle_mini.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return false
    Severity: Major
    Found in assets/js/overlib/mini/overlib_anchor_mini.js - About 30 mins to fix
      Severity
      Category
      Status
      Source
      Language