Showing 3,032 of 3,032 total issues
Method getItemsFromSearch
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getItemsFromSearch($queryArray = [], $andor = 'AND', $limit = 0, $offset = 0, $userid = 0, $categories = [], $sortby = 0, $searchin = '', $extra = '')
Method getAllPublished
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getAllPublished($limit = 0, $start = 0, $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $idKey = 'none', $excludeExpired = true)
Method xoops_module_install_publisher
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_install_publisher(\XoopsModule $module)
{
require \dirname(__DIR__) . '/preloads/autoloader.php';
$helper = Helper::getInstance();
Method serveExternalImage
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function serveExternalImage()
{
if (!preg_match('/^https?:\/\/[a-zA-Z0-9\-\.]+/i', $this->src)) {
$this->error('Invalid URL supplied.');
Method insert
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function insert(\XoopsObject $obj, $force = false)// insert($obj, $force = false)
{
// Make sure object is of correct type
if (0 != \strcasecmp($this->className, \get_class($obj))) {
return false;
Method getGrantedGroupsById
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getGrantedGroupsById($gpermName, $id)
{
static $items;
if (isset($items[$gpermName][$id])) {
return $items[$gpermName][$id];
Function publisher_tag_iteminfo
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function publisher_tag_iteminfo(&$items)
{
if (empty($items) || !is_array($items)) {
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 xoops_module_install_publisher
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_install_publisher(\XoopsModule $module)
{
require \dirname(__DIR__) . '/preloads/autoloader.php';
$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
Function findMetaKeywords
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function findMetaKeywords($text, $minChar)
{
$keywords = [];
$text = $this->purifyText($text);
$text = $this->html2text($text);
- 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 getCountsByCat
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getCountsByCat($catId, $status, $inSubCat = false)
{
// global $resultCatCounts;
$ret = [];
- 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 setTitle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function setTitle($title): void
{
$this->title = $this->html2text($title);
$this->originalTitle = $this->title;
$titleTag = [];
- 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 getCategoriesForSearch
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getCategoriesForSearch()
{
global $theresult;
$ret = [];
- 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 getArray
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getArray($mimeExt = null)
{
// global $publisherIsAdmin;
$ret = [];
if ($GLOBALS['xoopsUser'] && !$this->publisherIsAdmin) {
- 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 getCategoriesForSubmit
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function &getCategoriesForSubmit()
{
global $theresult;
$ret = [];
$criteria = new \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
Method getGrantedItems
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getGrantedItems($gpermName)
{
static $items;
if (isset($items[$gpermName])) {
return $items[$gpermName];
Identical blocks of code found in 2 locations. Consider refactoring. Open
public function __construct(\XoopsDatabase $db = null, Helper $helper = null)
{
/** @var Helper $this- >helper */
$this->helper = $helper ?? Helper::getInstance();
$this->db = $db;
- 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 102.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
public function __construct(\XoopsDatabase $db = null, Helper $helper = null)
{
$this->helper = $helper ?? Helper::getInstance();
$this->db = $db;
$this->publisherIsAdmin = $this->helper->isUserAdmin();
- 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 102.
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
Method editFile
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function editFile($showmenu = false, $fileid = 0, $itemId = 0): void
{
$helper = Helper::getInstance();
require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
Similar blocks of code found in 2 locations. Consider refactoring. Open
$modversion['config'][] = [
'name' => 'submit_status',
'title' => '_MI_PUBLISHER_FORM_STATUS',
'description' => '_MI_PUBLISHER_FORM_STATUS_DSC',
'formtype' => 'select',
- 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 102.
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
$modversion['config'][] = [
'name' => 'submit_edit_status',
'title' => '_MI_PUBLISHER_FORM_EDIT_STATUS',
'description' => '_MI_PUBLISHER_FORM_EDIT_STATUS_DSC',
'formtype' => 'select',
- 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 102.
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