Showing 355 of 3,032 total issues
Method getImages
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getImages()
{
static $ret;
$itemId = (int)$this->getVar('itemid');
if (!isset($ret[$itemId])) {
Function run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
if ($this->isURL) {
if (!ALLOW_EXTERNAL) {
$this->debug(1, 'Got a request for an external image but ALLOW_EXTERNAL is disabled so returning error msg.');
- 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 getItems
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getItems($limit = 0, $start = 0, $status = '', $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $otherCriteria = null, $idKey = 'none')
Function insert
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function insert(\XoopsObject $item, $force = false) //insert(&$item, $force = false)
{
if (!$item->meta_keywords() || !$item->meta_description() || !$item->short_url()) {
$publisherMetagen = new Metagen($item->getTitle(), $item->getVar('meta_keywords'), $item->getVar('summary'));
// Auto create meta tags if empty
- 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 ratingBar
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function ratingBar($itemId)
{
$helper = Helper::getInstance();
$ratingUnitWidth = 30;
$units = 5;
- 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 createDir
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function createDir(): void
{
// auto crate folders
// $thePath = static::getUploadDir();
- 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 rrmdir
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function rrmdir($src)
{
// Only continue if user is a 'global' Admin
if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
return 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"
Further reading
Function manage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function manage($icons): void
{
$helper = Helper::getInstance();
$utility = new Utility();
/** @var MimetypeHandler $mimetypeHandler */
- 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 getCount
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getCount(\CriteriaElement $criteria = null, $notNullFields = null)
{
// $notNullFields = $notNullFields ?? null;
$sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix($this->helper->getDirname() . '_items');
if (null !== $criteria && ($criteria instanceof \Criteria || $criteria instanceof \CriteriaCompo)) {
- 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 storeUpload
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function storeUpload($postField, $allowedMimetypes, &$errors)
{
/** @var MimetypeHandler $mimetypeHandler */
$mimetypeHandler = $this->helper->getHandler('Mimetype');
$itemId = $this->getVar('itemid');
- 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 cleanCache
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function cleanCache()
{
if (FILE_CACHE_TIME_BETWEEN_CLEANS < 0) {
return null;
}
Method getKey
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getKey(string $line): array
{
$key = [];
if (\strpos($line, 'RIMARY') > 0) {
Method loadTableFromArrayWithReplace
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadTableFromArrayWithReplace($table, $data, $search, $replace)
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
Method getCountsByCat
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCountsByCat($catId, $status, $inSubCat = false)
{
// global $resultCatCounts;
$ret = [];
Method getServerStats
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getServerStats()
{
//mb $wfdownloads = WfdownloadsWfdownloads::getInstance();
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Method storeUpload
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function storeUpload($postField, $allowedMimetypes, &$errors)
{
/** @var MimetypeHandler $mimetypeHandler */
$mimetypeHandler = $this->helper->getHandler('Mimetype');
$itemId = $this->getVar('itemid');
Method getFormConfirm
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFormConfirm(): \XoopsThemeForm
{
$moduleDirName = \basename(__DIR__);
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
//in order to be accessable from user and admin area this should be place in language common.php
Function onload
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
preloader.onload = function () {
// remove loading class
ppyStageWrap.removeClass(lclass);
Method tryServerCache
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function tryServerCache()
{
$this->debug(3, 'Trying server cache');
if (is_file($this->cachefile)) {
$this->debug(3, "Cachefile {$this->cachefile} exists");
Method mms
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mms(&$patterns, &$replacements): void
{
$patterns[] = "/\[mms=(['\"]?)([^\"']*),([^\"']*)\\1]([^\"]*)\[\/mms\]/sU";
$rp = "<OBJECT id=videowindow1 height='\\3' width='\\2' classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'>";
$rp .= '<PARAM NAME="URL" VALUE="\\4">';