Showing 155 of 201 total issues
Function wfl_address
has a Cognitive Complexity of 768 (exceeds 5 allowed). Consider refactoring. Open
function wfl_address($street1, $street2, $town, $state, $zip, $country = '')
{
if ('Albania' === $country) {
if ($street2) {
$address = $street1 . '<br>' . $street2 . '<br>' . $town;
- 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 wfl_address
has 1133 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wfl_address($street1, $street2, $town, $state, $zip, $country = '')
{
if ('Albania' === $country) {
if ($street2) {
$address = $street1 . '<br>' . $street2 . '<br>' . $town;
File Utility.php
has 1387 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace XoopsModules\Wflinks;
/*
Method wflinks_sbmarks
has 706 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wflinks_sbmarks($lid)
{
global $xoopsDB, $xoopsModule, $myts;
$sbmark_arr = $xoopsDB->fetchArray($xoopsDB->query('SELECT title FROM ' . $xoopsDB->prefix('wflinks_links') . ' WHERE lid=' . (int)$lid . ''));
File address.php
has 1137 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Module: WF-Links
* Developer: McDonald
File xoops_version.php
has 727 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Module: WF-Links
* Version: v1.0.9
File sbookmarks.php
has 710 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Module: WF-Links
* Developer: McDonald
File modinfo.php
has 642 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Module: WF-links
* Version: v1.0.3
* Release Date: 21 June 2005
Method getCountryName
has 260 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getCountryName($countryn)
{
$country_array = [
'' => 'Unknown',
'-' => 'Unknown',
Method edit
has 255 lines of code (exceeds 25 allowed). Consider refactoring. Open
function edit($lid = 0)
{
global $xoopsDB, $myts, $mytree, $imageArray, $xoopsConfig, $xoopsModule, $xoopsUser;
/** @var Helper $helper */
$helper = Helper::getInstance();
File main.php
has 586 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Module: WF-Links
* Version: v1.0.3
* Release Date: 21 June 2005
Method listBlocks
has 213 lines of code (exceeds 25 allowed). Consider refactoring. Open
function listBlocks()
{
global $xoopsModule, $pathIcon16;
require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
$moduleDirName = basename(dirname(__DIR__));
Function xoops_module_update_wflinks
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_update_wflinks(\XoopsModule $module, $previousVersion = null)
{
$moduleDirName = basename(dirname(__DIR__));
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
- 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($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
{
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
- 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 list_blocks
has 204 lines of code (exceeds 25 allowed). Consider refactoring. Open
function list_blocks()
{
global $query4redirect, $block_arr;
// cachetime options
$cachetimes = [
File blocksadmin.php
has 491 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* 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 list_blocks
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
function list_blocks()
{
global $query4redirect, $block_arr;
// cachetime options
$cachetimes = [
- 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 admin.php
has 441 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Module: WF-links
* Version: v1.0.3
Function listBlocks
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
function listBlocks()
{
global $xoopsModule, $pathIcon16;
require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
$moduleDirName = basename(dirname(__DIR__));
- 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
Utility
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
class Utility extends Common\SysUtility
{
//--------------- Custom module methods -----------------------------
/**
* getHandler()