Showing 216 of 316 total issues
File Utility.php
has 1187 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace XoopsModules\Lexikon;
/*
File functions.php
has 984 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* $Id: functions.php v 1.0 8 May 2004 hsalazar Exp $
* Module: Lexikon
* Author: hsalazar
File xoops_version.php
has 659 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Lexikon XOOPS glossary Module
*
Method listBlocks
has 212 lines of code (exceeds 25 allowed). Consider refactoring. Open
function listBlocks()
{
global $xoopsModule, $pathIcon16;
// require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
xoops_load('xoopslist');
Function xoops_module_update_lexikon
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_update_lexikon(\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
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
File blocksadmin.php
has 502 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
File entry.php
has 476 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Module: Lexikon - glossary module
* Author: hsalazar
* Modifs: Yerres
File blocksadmin.inc.php
has 455 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 DefinitionImport
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
function DefinitionImport($delete)
{
global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $entryID, $myts;
$sqlQuery = $xoopsDB->query('SELECT count(entryID) AS count FROM ' . $xoopsDB->prefix('wbentries'));
[$count] = $xoopsDB->fetchRow($sqlQuery);
- 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 entrySave
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
function entrySave($entryID = '')
{
global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB;
$helper = Helper::getInstance();
$utility = new Utility();
- 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 DefinitionImport
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
function DefinitionImport($delete)
{
global $xoopsConfig, $xoopsDB, $xoopsModule, $myts;
$sqlQuery = $xoopsDB->query('SELECT count(id) AS count FROM ' . $xoopsDB->prefix('dictionary'));
[$count] = $xoopsDB->fetchRow($sqlQuery);
- 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 DefinitionImport
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function DefinitionImport($delete)
{
global $xoopsConfig, $xoopsDB, $xoopsModule;
$myts = \MyTextSanitizer::getInstance();
$sqlQuery = $xoopsDB->query('SELECT count(entryID) AS count FROM ' . $xoopsDB->prefix('xwords_ent'));
- 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 DefinitionImport
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DefinitionImport($delete)
{
global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $entryID, $myts;
$sqlQuery = $xoopsDB->query('SELECT count(entryID) AS count FROM ' . $xoopsDB->prefix('wbentries'));
[$count] = $xoopsDB->fetchRow($sqlQuery);
Method entryEdit
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
function entryEdit($entryID = '')
{
global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $init;
$helper = Helper::getInstance();
Function listBlocks
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
function listBlocks()
{
global $xoopsModule, $pathIcon16;
// require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
xoops_load('xoopslist');
- 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 43 functions (exceeds 20 allowed). Consider refactoring. Open
class Utility extends Common\SysUtility
{
//--------------- Custom module methods -----------------------------
/**
* static::getLinkedUnameFromId()
Method DefinitionImport
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DefinitionImport($delete)
{
global $xoopsConfig, $xoopsDB, $xoopsModule;
$myts = \MyTextSanitizer::getInstance();
$sqlQuery = $xoopsDB->query('SELECT count(entryID) AS count FROM ' . $xoopsDB->prefix('xwords_ent'));
Function lx_search
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
function lx_search($queryarray, $andor, $limit, $offset, $userid)
{
global $xoopsDB, $xoopsUser;
// -- search comments + highlighter
$highlight = 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"