File functions.php
has 520 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
* which is considered copyrighted (c) material of the original comment or credit authors.
Method news_createmeta_keywords
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
function news_createmeta_keywords($content)
{
require_once XOOPS_ROOT_PATH . '/modules/news/config.php';
// require_once XOOPS_ROOT_PATH . '/modules/news/class/blacklist.php';
// require_once XOOPS_ROOT_PATH . '/modules/news/class/registryfile.php';
Function news_CreateMetaDatas
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function news_CreateMetaDatas($story = null): void
{
global $xoopsConfig, $xoTheme, $xoopsTpl;
$content = '';
$myts = \MyTextSanitizer::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
Method news_CreateMetaDatas
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function news_CreateMetaDatas($story = null): void
{
global $xoopsConfig, $xoTheme, $xoopsTpl;
$content = '';
$myts = \MyTextSanitizer::getInstance();
Method news_getWysiwygForm
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function news_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
{
$editor_option = \mb_strtolower(news_getmoduleoption('form_options'));
$editor = false;
$editor_configs = [];
Function news_createmeta_keywords
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function news_createmeta_keywords($content)
{
require_once XOOPS_ROOT_PATH . '/modules/news/config.php';
// require_once XOOPS_ROOT_PATH . '/modules/news/class/blacklist.php';
// require_once XOOPS_ROOT_PATH . '/modules/news/class/registryfile.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
Function news_close_tags
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function news_close_tags($string)
{
// match opened tags
if (preg_match_all('/<([a-z\:\-]+)[^\/]>/', $string, $start_tags)) {
$start_tags = $start_tags[1];
- 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 news_html2text
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function news_html2text($document)
{
// PHP Manual:: function preg_replace
// $document should contain an HTML document.
// This will remove HTML tags, javascript sections
Function news_getWysiwygForm
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function news_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
{
$editor_option = \mb_strtolower(news_getmoduleoption('form_options'));
$editor = false;
$editor_configs = [];
- 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 news_getmoduleoption
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function news_getmoduleoption($option, $repmodule = 'news')
{
global $xoopsModuleConfig, $xoopsModule;
static $tbloptions = [];
if (is_array($tbloptions) && array_key_exists($option, $tbloptions)) {
- 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 news_updateCache
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function news_updateCache(): void
{
global $xoopsModule;
$folder = $xoopsModule->getVar('dirname');
$tpllist = [];
- 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 news_getWysiwygForm
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function news_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
Method news_resizePicture
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$src_path,
$dst_path,
$param_width,
$param_height,
$keep_original = false,
Function news_resizePicture
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function news_resizePicture(
$src_path,
$dst_path,
$param_width,
$param_height,
- 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"