Showing 573 of 5,122 total issues
Function xoops_module_update_adslight
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_update_adslight(\XoopsModule $module, $previousVersion = null): bool
{
global $xoopsDB;
$moduleDirName = \basename(\dirname(__DIR__));
$helper = Helper::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 truncateHtml
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
public static function truncateHtml(
string $text,
?int $length = 100,
string $ending = '...',
bool $exact = 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 findRows
has 205 lines of code (exceeds 25 allowed). Consider refactoring. Open
findRows: function( table, filters, currentFilters ) {
if (
tsf.equalFilters(table.config, table.config.lastSearch, currentFilters) ||
!table.config.widgetOptions.filter_initialized
) {
Function findRows
has 205 lines of code (exceeds 25 allowed). Consider refactoring. Open
findRows: function( table, filters, currentFilters ) {
if (
tsf.equalFilters(table.config, table.config.lastSearch, currentFilters) ||
!table.config.widgetOptions.filter_initialized
) {
File main.php
has 504 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
/*
-------------------------------------------------------------------------
ADSLIGHT 2: Module for Xoops
Function init
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function( table ) {
// filter language options
ts.language = $.extend( true, {}, {
to : 'to',
or : 'or',
Function init
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function( table ) {
// filter language options
ts.language = $.extend( true, {}, {
to : 'to',
or : 'or',
File viewads.php
has 467 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
Function format
has 180 lines of code (exceeds 25 allowed). Consider refactoring. Open
format: function(table, c, wo) {
// filter widget doesn't initialize on an empty table. Fixes #449
if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
return;
}
Function format
has 180 lines of code (exceeds 25 allowed). Consider refactoring. Open
format: function(table, c, wo) {
// filter widget doesn't initialize on an empty table. Fixes #449
if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
return;
}
Function Deferred
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
Deferred: function( func ) {
var tuples = [
// action, add listener, callbacks,
// ... .then handlers, argument index, [final state]
File admin.php
has 461 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
/*
-------------------------------------------------------------------------
ADSLIGHT 2 : Module for Xoops
Method modifyAd
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
function modifyAd($lid): void
{
global $xoopsDB, $xoopsModule, $xoopsConfig, $myts, $desctext;
$helper = Helper::getInstance();
File options.php
has 443 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
File modify.php
has 441 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
Method index
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
function index(): void
{
global $xoopsDB, $xoopsModule, $myts, $desctext, $admin_lang;
$helper = Helper::getInstance();
$mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
Method modifyAds
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
function modifyAds($lid): void
{
global $xoopsDB, $xoopsModule, $myts, $desctext, $admin_lang;
$mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
$helper = Helper::getInstance();
Method modifyAds
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
function modifyAds($lid): void
{
global $xoopsDB, $myts, $desctext, $admin_lang;
$helper = Helper::getInstance();
$mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
Method listBlocks
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function listBlocks(): void
{
$pathIcon16 = Admin::iconUrl('', '16');
require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
Function expireAd
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public static function expireAd(): void
{
global $xoopsDB, $xoopsConfig, $xoopsModule, $myts, $meta;
$helper = Helper::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"