mambax7/smartfaq

View on GitHub

Showing 374 of 649 total issues

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

function olMouseMove(e) {
    var e = (e) ? e : event;
    if (e.pageX) {
        o3_x = e.pageX;
        o3_y = e.pageY;
Severity: Minor
Found in assets/js/overlib/mini/overlib_mini.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 registerCmdLineFunction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function registerCmdLineFunction(fn) {
    if (isFunction(fn)) {
        if (typeof cmdLine == 'undefined') cmdLine = new Array();
        if (typeof fn == 'object') {
            cmdLine = cmdLine.concat(fn);
Severity: Minor
Found in assets/js/overlib/mini/overlib_mini.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 checkAnchorObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function checkAnchorObject() {
    var w = o3_anchor;
    if (w) {
        if (!(mrkObj = getAnchorObjectRef(w))) {
            if (o3_noanchorwarn) {
Severity: Minor
Found in assets/js/overlib/mini/overlib_anchor_mini.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 registerCmdLineFunction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function registerCmdLineFunction(fn) {
    if (isFunction(fn)) {
        if (typeof cmdLine == 'undefined') cmdLine = new Array();
        if (typeof fn == 'object') {
            cmdLine = cmdLine.concat(fn);
Severity: Minor
Found in assets/js/overlib/overlib.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 olMouseMove has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function olMouseMove(e) {
    var e = (e) ? e : event;

    if (e.pageX) {
        o3_x = e.pageX;
Severity: Minor
Found in assets/js/overlib/overlib.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 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/FaqHandler.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 smartfaq_notify_iteminfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function smartfaq_notify_iteminfo($category, $item_id)
{
    global $xoopsModule, $xoopsModuleConfig, $xoopsConfig;

    if (empty($xoopsModule) || 'smartfaq' !== $xoopsModule->getVar('dirname')) {
Severity: Minor
Found in include/notification.inc.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_smartfaq has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function xoops_module_install_smartfaq(\XoopsModule $module)
{
    require \dirname(__DIR__, 3) . '/mainfile.php';

    $moduleDirName = \basename(\dirname(__DIR__));
Severity: Minor
Found in include/oninstall.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 loadSampleData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function loadSampleData(): void
{
    global $xoopsConfig;
    $moduleDirName      = \basename(\dirname(__DIR__));
    $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Severity: Minor
Found in testdata/index.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 checkAnchorObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function checkAnchorObject() {
    var w = o3_anchor;

    if (w) {
        if (!(mrkObj = getAnchorObjectRef(w))) {
Severity: Minor
Found in assets/js/overlib/overlib_anchor.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 delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete(\XoopsObject $object, $force = false)
    {
        if ('xoopsmodules\smartfaq\category' !== \mb_strtolower(\get_class($object))) {
            return false;
        }
Severity: Minor
Found in class/CategoryHandler.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 answer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function answer()
    {
        $answerHandler = new Smartfaq\AnswerHandler($this->db);
        switch ($this->status()) {
            case Constants::SF_STATUS_SUBMITTED:
Severity: Minor
Found in class/Faq.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 getPermissions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPermissions($type = 'category', $id = null)
    {
        global $xoopsUser;
        static $permissions;

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

    public function getCategoryPath($withAllLink = false, $open = false)
    {
        $filename = 'category.php';
        if ($open) {
            $filename = 'open_category.php';
Severity: Minor
Found in class/Category.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