Showing 236 of 310 total issues
Function b_news_top_show
has a Cognitive Complexity of 281 (exceeds 5 allowed). Consider refactoring. Open
function b_news_top_show($options)
{
global $xoopsConfig;
/** @var Helper $helper */
- 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 index.php
has 1675 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
//
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000-2020 XOOPS.org //
File NewsStory.php
has 1244 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\News;
/*
Method b_news_top_show
has 475 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_news_top_show($options)
{
global $xoopsConfig;
/** @var Helper $helper */
Method topicsmanager
has 395 lines of code (exceeds 25 allowed). Consider refactoring. Open
function topicsmanager(): void
{
global $xoopsDB, $xoopsConfig, $xoopsModule, $myts;
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
xoops_cp_header();
File xoops_version.php
has 646 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.
Function store
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
public function store()
{
$myts = MyTextSanitizer::getInstance();
$title = '';
$imgurl = '';
- 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 store
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
public function store()
{
$myts = \MyTextSanitizer::getInstance();
$title = '';
$imgurl = '';
- 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 news_top.php
has 593 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.
File Utility.php
has 557 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\News;
use MyTextSanitizer;
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.
Function xoops_module_update_news
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_update_news(\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
File Blocksadmin.php
has 509 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace XoopsModules\News\Common;
File submit.php
has 504 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.
File NewsTopic.php
has 475 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\News;
/*
Function addTopic
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
function addTopic(): void
{
global $xoopsDB, $xoopsModule;
$helper = Helper::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
XoopsStory
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
class XoopsStory
{
public $table;
public $storyid;
public $topicid;
NewsStory
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
class NewsStory extends XoopsStory
{
public $newstopic; // XoopsTopic object
public $rating; // News rating
public $votes; // Number of votes
Method PrintPage
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PrintPage(): void
{
global $xoopsConfig, $xoopsModule, $story, $xoops_meta_keywords, $xoops_meta_description;
$myts = \MyTextSanitizer::getInstance();
$datetime = formatTimestamp($story->published(), News\Utility::getModuleOption('dateformat')); ?>