Showing 201 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($helper->getConfig('useaddress')) {
$googlemap = ('http://maps.google.com' !== $_POST['googlemap']) ? $myts->addSlashes($_POST['googlemap']) : '';
$yahoomap = ('http://maps.yahoo.com' !== $_POST['yahoomap']) ? $myts->addSlashes($_POST['yahoomap']) : '';
$multimap = ('http://www.multimap.com' !== $_POST['multimap']) ? $myts->addSlashes($_POST['multimap']) : '';
$street1 = $myts->addSlashes(ltrim($_REQUEST['street1']));
- 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 437.
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 2 locations. Consider refactoring. Open
if ($helper->getConfig('useaddress')) {
$googlemap = ('http://maps.google.com' !== $_POST['googlemap']) ? $myts->addSlashes($_POST['googlemap']) : '';
$yahoomap = ('http://maps.yahoo.com' !== $_POST['yahoomap']) ? $myts->addSlashes($_POST['yahoomap']) : '';
$multimap = ('http://www.multimap.com' !== $_POST['multimap']) ? $myts->addSlashes($_POST['multimap']) : '';
$street1 = $myts->addSlashes(trim($_POST['street1']));
- 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 437.
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 2 locations. Consider refactoring. Open
if ('clone' === $op) {
xoops_cp_header();
$myblock = new \XoopsBlock($bid);
$db = \XoopsDatabaseFactory:: getDatabaseConnection();
- 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 387.
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 2 locations. Consider refactoring. Open
if ('edit' === $op) {
xoops_cp_header();
// edit_block($bid); GIJ imported from blocksadmin.php
$myblock = new \XoopsBlock($bid);
- 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 387.
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 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.