Showing 5,122 of 5,122 total issues
Function listingDel
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
function listingDel($lid, $ok): void
{
global $xoopsDB;
$helper = Helper::getInstance();
$sql = 'SELECT usid FROM ' . $xoopsDB->prefix('adslight_listing') . ' WHERE lid=' . $xoopsDB->escape($lid);
- 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 indexView
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
function indexView($lid = null): void
{
global $xoopsDB, $myts, $desctext, $admin_lang;
$helper = Helper::getInstance();
$mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
Method index
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
function index(): void
{
global $xoopsDB, $myts, $desctext;
$mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
Method adslight_seo_title
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
function adslight_seo_title($title = '', $withExt = false)
{
/**
* if XOOPS ML is present, let's sanitize the title with the current language
*/
File modify_ads.php
has 386 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 index
has a Cognitive Complexity of 35 (exceeds 5 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');
- 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 buildCache
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildCache : function( c, callback, $tbodies ) {
var cache, val, txt, rowIndex, colIndex, tbodyIndex, $tbody, $row,
cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData,
colMax, span, cacheIndex, hasParser, max, len, index,
table = c.table,
Function buildCache
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildCache : function( c, callback, $tbodies ) {
var cache, val, txt, rowIndex, colIndex, tbodyIndex, $tbody, $row,
cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData,
colMax, span, cacheIndex, hasParser, max, len, index,
table = c.table,
Similar blocks of code found in 3 locations. Consider refactoring. Open
if ($numrows > 0) {
echo '<form method="post" action="options.php">
<b>' . _AM_ADSLIGHT_MODCONDITION . '</b></font><br><br>';
$sql = 'SELECT id_condition, nom_condition FROM ' . $xoopsDB->prefix('adslight_condition') . ' ORDER BY nom_condition';
$result8 = $xoopsDB->query($sql);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 184.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
if ($numrows > 0) {
echo '<form method="post" action="options.php">
<b>' . _AM_ADSLIGHT_MODTYPE . '</b></font><br><br>';
$sql = 'SELECT id_type, nom_type FROM ' . $xoopsDB->prefix('adslight_type') . ' ORDER BY nom_type';
$result2 = $xoopsDB->query($sql);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 184.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
if ($numrows > 0) {
echo '<form method="post" action="options.php">
<b>' . _AM_ADSLIGHT_MODPRICE . '</b></font><br><br>';
$sql = 'SELECT id_price, nom_price FROM ' . $xoopsDB->prefix('adslight_price') . ' ORDER BY nom_price';
$result3 = $xoopsDB->query($sql);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 184.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File viewcats.php
has 374 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 initSort
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
initSort : function( c, cell, event ) {
if ( c.table.isUpdating ) {
// let any updates complete before initializing a sort
return setTimeout( function() {
ts.initSort( c, cell, event );
Function initSort
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
initSort : function( c, cell, event ) {
if ( c.table.isUpdating ) {
// let any updates complete before initializing a sort
return setTimeout( function() {
ts.initSort( c, cell, event );
File lightbox.js
has 373 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Lightbox v2.11.3
* by Lokesh Dhakar
*
* More info:
Function defaultPrefilter
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
function defaultPrefilter( elem, props, opts ) {
var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
isBox = "width" in props || "height" in props,
anim = this,
orig = {},
Function Callbacks
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.Callbacks = function( options ) {
// Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
options = typeof options === "string" ?
Method getFormFeedback
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFormFeedback($action = false): \XoopsThemeForm
{
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
}
Function listBlocks
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function listBlocks(): void
{
$pathIcon16 = Admin::iconUrl('', '16');
require_once XOOPS_ROOT_PATH . '/class/xoopslists.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
File Tree.php
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\Adslight;
/*