mambax7/smartobject

View on GitHub

Showing 1,188 of 1,188 total issues

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

    public function displaySingleObject(
        $fetchOnly = false,
        $userSide = false,
        $actions = [],
        $headerAsRow = true
Severity: Minor
Found in class/BaseSmartObject.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 editclass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function editclass($showmenu = false, $currencyid = 0)
{
    global $smartobjectCurrencyHandler;

    $currencyObj = $smartobjectCurrencyHandler->get($currencyid);
Severity: Minor
Found in admin/currency.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 _options_for_javascript has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _options_for_javascript($options)
    {
        $return_val = '';

        if (is_array($options)) {
Severity: Minor
Found in include/projax/classes/JavaScript.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 inspect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    inspect: function (object) {
        try {
            if (object == undefined) return 'undefined';
            if (object == null) return 'null';
            return object.inspect ? object.inspect() : object.toString();
Severity: Minor
Found in include/scriptaculous/lib/prototype.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 _options_for_javascript has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _options_for_javascript($options)
    {
        $return_val = '';

        if (is_array($options)) {
Severity: Minor
Found in include/projax_/classes/JavaScript.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 addObjectsFromItemName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function addObjectsFromItemName($item, $modulename = false, $criteria = false)
    {
        if (!$modulename) {
            global $xoopsModule;
            if (!is_object($xoopsModule)) {
Severity: Minor
Found in class/ObjectsRegistry.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 getConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getConfig($key, $moduleName = false, $default = 'default_is_undefined')
    {
        if (!$moduleName) {
            $moduleName = static::getCurrentModuleName();
        }
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 getCurrency has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getCurrency($var, $currencyObj = false)
    {
        $ret = static::getFloat($var, ['single_dot_as_decimal' => true]);
        $ret = round($ret, 2);
        // make sur we have at least .00 in the $var
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

Severity
Category
Status
Source
Language