Showing 264 of 3,642 total issues
Method getFormSongs
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getFormSongs($object, $as_array = false)
{
if (!\is_object($object)) {
$handler = Helper::getInstance()
->getHandler('Songs');
File JSON.php
has 421 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
/*
Module: Document
File Field.php
has 415 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\Songlist;
use function base64_decode;
Function toArray
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function toArray($extra = true): array
{
$ret = parent::toArray();
$GLOBALS['myts'] = MyTextSanitizer::getInstance();
- 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 getEditElement
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
public function getEditElement($user, $profile)
{
$value = \in_array($this->getVar('field_name'), $this->getPostVars(), true) ? $user->getVar($this->getVar('field_name'), 'e') : $profile->getVar($this->getVar('field_name'), 'e');
if (null === $value) {
$value = $this->getVar('field_default');
- 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 getSearchElement
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public function getSearchElement()
{
$caption = $this->getVar('field_title');
$caption = \defined($caption) ? \constant($caption) : $caption;
$name = $this->getVar('field_name', 'e');
- 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 36 (exceeds 5 allowed). Consider refactoring. Open
public function insert(\XoopsObject $obj, $force = false)
{
$objectsHandler = \XoopsModules\Songlist\Helper::getInstance()->getHandler('Extras');
$obj->setVar('field_name', \str_replace(' ', '_', $obj->getVar('field_name')));
$obj->cleanVars();
- 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 _encode
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _encode($var)
{
switch (gettype($var)) {
case 'boolean':
return $var ? 'true' : 'false';
Method getEditElement
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getEditElement($user, $profile)
{
$value = \in_array($this->getVar('field_name'), $this->getPostVars(), true) ? $user->getVar($this->getVar('field_name'), 'e') : $profile->getVar($this->getVar('field_name'), 'e');
if (null === $value) {
$value = $this->getVar('field_default');
Function listBlocks
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function listBlocks(): void
{
global $xoopsModule, $pathIcon16;
require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
// xoops_loadLanguage('admin', 'system');
- 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 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function insert(\XoopsObject $obj, $force = false)
{
$objectsHandler = \XoopsModules\Songlist\Helper::getInstance()->getHandler('Extras');
$obj->setVar('field_name', \str_replace(' ', '_', $obj->getVar('field_name')));
$obj->cleanVars();
Method getSearchElement
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSearchElement()
{
$caption = $this->getVar('field_title');
$caption = \defined($caption) ? \constant($caption) : $caption;
$name = $this->getVar('field_name', 'e');
File index.php
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
use XoopsModules\Songlist\Form\SelectCategoryForm;
use XoopsModules\Songlist\Form\SelectGenreForm;
use XoopsModules\Songlist\Form\SelectVoiceForm;
Method insert
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function insert(\XoopsObject $obj, $force = true)
{
if ($obj->isNew()) {
$obj->setVar('created', \time());
$new = true;
Method xml2array
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
{
if (!$contents) {
return [];
}
Method render
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(?array $block = null): void
{
\xoops_load('XoopsFormLoader');
\xoops_loadLanguage('common', $this->moduleDirNameUpper);
Method toArray
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toArray($extra = true): array
{
$ret = parent::toArray();
$GLOBALS['myts'] = MyTextSanitizer::getInstance();
Function xoops_module_update_vs_executesql
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_update_vs_executesql($sql): bool
{
if (is_string($sql)) {
if ($GLOBALS['xoopsDB']->queryF($sql)) {
xoops_error($sql, 'SQL Executed Successfully!!!');
- 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 permissions.php
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
/*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
Function toArray
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function toArray($extra = false): array
{
$ret = parent::toArray();
$form = $this->getForm(true);
foreach ($form as $key => $element) {
- 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"