mambax7/smartobject

View on GitHub

Showing 646 of 1,188 total issues

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

    public function toArray()
    {
        $ret  = [];
        $vars =& $this->getVars();
        foreach ($vars as $key => $var) {
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 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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function render()
    {
        $ret = '';
        if (count($this->getOptions()) > 1 && '[]' !== substr($this->getName(), -2, 2)) {
            $newname = $this->getName() . '[]';
Severity: Minor
Found in class/Form/Elements/SmartFormCheckElement.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 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 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