Showing 264 of 3,642 total issues
Function getFilterCriteria
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getFilterCriteria($filter): \CriteriaCompo
{
$parts = \explode('|', $filter);
$criteria = new \CriteriaCompo();
foreach ($parts as $part) {
- 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 getOutputValue
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getOutputValue($user, $profile)
{
\xoops_loadLanguage('modinfo', 'objects');
$value = \in_array($this->getVar('field_name'), $this->getPostVars(), true) ? $user->getVar($this->getVar('field_name')) : $profile->getVar($this->getVar('field_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
Function getFilterCriteria
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getFilterCriteria($filter): CriteriaCompo
{
$parts = \explode('|', $filter);
$criteria = new CriteriaCompo();
foreach ($parts as $part) {
- 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 getFilterCriteria
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getFilterCriteria($filter): \CriteriaCompo
{
$parts = \explode('|', $filter);
$criteria = new \CriteriaCompo();
foreach ($parts as $part) {
- 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 render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(): string
{
// load all child ids for javascript codes
foreach (array_keys($this->_itemTree) as $item_id) {
$this->_itemTree[$item_id]['allchild'] = [];
Method upload
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upload($chmod = 0644): bool
{
if ('' == $this->uploadDir) {
$this->setErrors('Upload directory not set');
Function addVote
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function addVote($sid, $value): bool
{
$criteria = new CriteriaCompo(new Criteria('sid', $sid));
$ip = Utility::getIPData(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
Function getFilterURLComponents
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getFilterURLComponents($filter, $field, $sort = 'created'): array
{
$parts = \explode('|', $filter);
$ret = [];
$value = '';
- 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 toXml
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function toXml($array, $name, $standalone, $beginning, $nested): string
{
$output = '';
if ($beginning) {
if ($standalone) {
- 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 isBlockCloned
has a Cognitive Complexity of 12 (exceeds 5 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');
- 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 toXml
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function toXml($array, $name, $standalone, $beginning, $nested): string
{
$output = '';
if ($beginning) {
if ($standalone) {
Method fetchMedia
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetchMedia($index_name, $index = null): bool
{
if (!isset($_FILES[$index_name])) {
$this->setErrors('File not found');
Method orderBlock
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function orderBlock(
array $bid,
array $oldtitle,
array $oldside,
array $oldweight,
Method __construct
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($caption, $name, $value = null, $size = 1, $multiple = false, $id = -1, $field = 'cid')
{
global $_form_object_options;
\xoops_loadLanguage('modinfo', 'songlist');
Method getURL
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getURL(): string
{
global $file, $op, $fct, $id, $value, $gid, $vid, $cid, $start, $limit;
if ($GLOBALS['songlistModuleConfig']['htaccess']) {
if (0 != $cid) {
Method getURL
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getURL(): string
{
global $file, $op, $fct, $id, $value, $gid, $vid, $vcid, $cid, $start, $limit;
if ($GLOBALS['songlistModuleConfig']['htaccess']) {
if (0 != $cid) {
Method getURL
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getURL(): string
{
global $file, $op, $fct, $id, $value, $gid, $vid, $cid, $start, $limit;
if ($GLOBALS['songlistModuleConfig']['htaccess']) {
if (0 != $cid) {
Method createLogo
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createLogo($dirname): bool
{
if (!\extension_loaded('gd')) {
return false;
}
Method cloneBlock
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cloneBlock(int $bid): void
{
//require __DIR__ . '/admin_header.php';
// \xoops_cp_header();
Method _renderOptionTree
has 32 lines of code (exceeds 25 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) {