Function getItems
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function getItems(array &$feed): void
{
$entries = [];
$db = \XoopsDatabaseFactory::getDatabaseConnection();
if (!empty($feed['plugin'])) {
- 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 FeedHandler.php
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace XoopsModules\Rssfit;
Function getChannel
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getChannel(array &$feed): void
{
$channel = [];
$elements = $this->miscHandler->getObjects2(new \Criteria('misc_category', 'channel'));
if (\is_array($elements) && !empty($elements)) {
- 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 doSubstr
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function doSubstr(string $text): string
{
$ret = $text;
$len = \function_exists('mb_strlen') ? mb_strlen($ret, $this->charset) : mb_strlen($ret);
$maxChars = $this->helper->getConfig('max_char');
- 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 getChannel
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getChannel(array &$feed): void
{
$channel = [];
$elements = $this->miscHandler->getObjects2(new \Criteria('misc_category', 'channel'));
if (\is_array($elements) && !empty($elements)) {
Method getItems
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getItems(array &$feed): void
{
$entries = [];
$db = \XoopsDatabaseFactory::getDatabaseConnection();
if (!empty($feed['plugin'])) {
Method feedSelectBox
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function feedSelectBox(string $caption = '', $selected = null, int $size = 1, bool $multi = true, bool $none = true, bool $main = true, string $name = 'feeds', string $type = 'id'): \XoopsFormSelect
Function getSticky
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getSticky(array &$feed): bool
{
if (!$intr = $this->miscHandler->getObjects2(new \Criteria('misc_category', 'sticky'))) {
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
Function getActivatedSubfeeds
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function &getActivatedSubfeeds(string $fields = '', string $type = ''): ?array
{
$ret = null;
$subs = $this->pluginHandler->getObjects2(new \Criteria('subfeed', '1'), $fields);
if (\is_array($subs) && !empty($subs)) {
- 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 checkSubFeed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function checkSubFeed(array &$feed): void
{
if (!empty($feed['plugin'])) {
$criteria = new \CriteriaCompo();
$criteria->add(new \Criteria('rssf_filename', \sprintf($this->pluginFile, $feed['plugin'])));
- 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"