Showing 264 of 3,642 total issues
Function _renderOptionTree
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = []): void
{
if ($option['id'] > 0) :
$tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="';
foreach ($parentIds as $pid) {
- 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 deleteDirectory
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function deleteDirectory($src): bool
{
// Only continue if user is a 'global' Admin
if (!($GLOBALS['xoopsUser'] instanceof XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
return 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"
Further reading
Method getIPData
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getIPData($ip = false): array
{
$ret = [];
if (\is_object($GLOBALS['xoopsUser'])) {
$ret['uid'] = $GLOBALS['xoopsUser']->getVar('uid');
Method getFormGenre
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getFormGenre($object, $as_array = false)
{
if (!\is_object($object)) {
$handler = Helper::getInstance()
->getHandler('Genre');
Method getFormVoice
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getFormVoice($object, $as_array = false)
{
if (!\is_object($object)) {
$handler = Helper::getInstance()
->getHandler('Voice');
Method getFormArtists
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getFormArtists($object, $as_array = false)
{
if (!\is_object($object)) {
$handler = Helper::getInstance()
->getHandler('Artists');
Function populateList
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function populateList($vars, $ownid = 0): void
{
foreach ($vars as $previd => $cats) {
if ($previd != $ownid || 0 == $ownid) {
foreach ($cats as $catid => $title) {
- 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 cloneFileFolder
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function cloneFileFolder($path)
{
global $patKeys;
global $patValues;
- 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 render
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function render(?array $block = null): void
{
\xoops_load('XoopsFormLoader');
\xoops_loadLanguage('common', $this->moduleDirNameUpper);
- 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 getFormUtf8map
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getFormUtf8map($object, $as_array = false)
{
if (!\is_object($object)) {
$handler = Helper::getInstance()
->getHandler('Utf8map');
Function getUserSearchForm
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function getUserSearchForm($action = false)
{
\xoops_loadLanguage('forms', 'songlist');
if (!$action) {
- 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 isBlockCloned
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isBlockCloned(int $bid, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
{
\xoops_loadLanguage('admin', 'system');
\xoops_loadLanguage('admin/blocksadmin', 'system');
\xoops_loadLanguage('admin/groups', 'system');
Method toArray
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toArray($extra = false): array
{
$ret = parent::toArray();
$form = $this->getForm(true);
foreach ($form as $key => $element) {
Function getFormAlbums
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function getFormAlbums($object, $as_array = false)
{
if (!\is_object($object)) {
$handler = Helper::getInstance()
->getHandler('Albums');
- 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 getFormCategory
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function getFormCategory($object, $as_array = false)
{
if (!\is_object($object)) {
$handler = Helper::getInstance()
->getHandler('Category');
- 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 getFormRequests
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function getFormRequests($object, $as_array = false)
{
if (!\is_object($object)) {
$handler = Helper::getInstance()
->getHandler('Requests');
- 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 getFormVotes
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function getFormVotes($object, $as_array = false)
{
if (!\is_object($object)) {
$handler = Helper::getInstance()
->getHandler('Votes');
- 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 getFilterElement
has a Cognitive Complexity of 15 (exceeds 5 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';
- 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 orderBlock
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
array $bid,
array $oldtitle,
array $oldside,
array $oldweight,
array $oldvisible,
Method toArray
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toArray($extra = true): array
{
$ret = parent::toArray();
$form = $this->getForm(true);
foreach ($form as $key => $element) {