Showing 264 of 3,642 total issues
Function insert
has a Cognitive Complexity of 170 (exceeds 5 allowed). Consider refactoring. Open
public function insert(\XoopsObject $obj, $force = true, $object = null)
{
if ($obj->isNew()) {
$new = true;
$old = $this->create();
- Read upRead up
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
File FormController.php
has 1053 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\Songlist\Form;
Function decode
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
public function decode($str)
{
$str = $this->reduce_string($str);
switch (mb_strtolower($str)) {
- Read upRead up
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 xml2array
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
{
if (!$contents) {
return [];
}
- Read upRead up
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
File Utility.php
has 609 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\Songlist;
use Xmf\Request;
Function insert
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
public function insert(XoopsObject $obj, $force = true, $object = null)
{
if ($obj->isNew()) {
$new = true;
$old = $this->create();
- Read upRead up
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
File Blocksadmin.php
has 591 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\Songlist\Common;
/**
File import.php
has 563 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
use Xmf\Module\Admin;
use Xmf\Request;
use XoopsModules\Songlist\Helper;
Function getFormSongs
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
public static function getFormSongs($object, $as_array = false)
{
if (!\is_object($object)) {
$handler = Helper::getInstance()
->getHandler('Songs');
- Read upRead up
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 listBlocks
has 219 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function listBlocks(): void
{
global $xoopsModule, $pathIcon16;
require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
// xoops_loadLanguage('admin', 'system');
Function truncateHtml
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true): string
{
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
- Read upRead up
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 insert
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
public function insert(\XoopsObject $obj, $force = true, $object = null)
{
if ($obj->isNew()) {
$new = true;
$old = $this->create();
- Read upRead up
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 getFieldForm
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getFieldForm($field, $action = false)
{
if (false === $action) {
$action = $_SERVER['SCRIPT_NAME'];
}
Function getFieldForm
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
public static function getFieldForm($field, $action = false)
{
if (false === $action) {
$action = $_SERVER['SCRIPT_NAME'];
}
- Read upRead up
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 getFilterElement
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
{
$components = static::getFilterURLComponents($filter, $field, $sort);
$ele = false;
require_once \dirname(__DIR__) . '/include/songlist.object.php';
Function insert
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
public function insert(\XoopsObject $obj, $force = true)
{
if ($obj->isNew()) {
$obj->setVar('created', \time());
$new = true;
- Read upRead up
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 insert
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function insert(\XoopsObject $obj, $force = true, $object = null)
{
if ($obj->isNew()) {
$new = true;
$old = $this->create();
Method decode
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function decode($str)
{
$str = $this->reduce_string($str);
switch (mb_strtolower($str)) {
File xoops_version.php
has 451 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
require_once __DIR__ . '/preloads/autoloader.php';
error_reporting(E_ALL);
Function _encode
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
public function _encode($var)
{
switch (gettype($var)) {
case 'boolean':
return $var ? 'true' : 'false';
- Read upRead up
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"