Showing 36 of 48 total issues
Function insert
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
public function insert(XoopsObject $obj, $force = false, $checkObject = true)
{
if ($checkObject !== false) {
if (!is_object($obj)) {
var_dump($obj);
- 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 getCSS
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCSS($ws = true)
{
if ($ws) {
$csscode = "<style type=\"text/css\">\n<!--";
}
File object.php
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* ****************************************************************************
* - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS
* - Licence GPL Copyright (c) (http://www.tdmxoops.net)
Method insert
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function insert(XoopsObject $obj, $force = false, $checkObject = true)
{
if ($checkObject !== false) {
if (!is_object($obj)) {
var_dump($obj);
Function convertResultSet
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function convertResultSet($result, $id_as_key = false, $as_object = true)
{
$ret = [];
while ($myrow = $this->db->fetchArray($result)) {
$obj = $this->create(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
Method getForm
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getForm($action = false)
{
global $xoopsDB, $xoopsModuleConfig, $xoopsModule;
if ($action === false) {
Function checkVerXoops
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function checkVerXoops(XoopsModule $module = null, $requiredVer = null)
{
$moduleDirName = basename(dirname(__DIR__));
if (null === $module) {
$module = XoopsModule::getByDirname($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
Method getForm
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getForm($action = false)
{
global $xoopsDB, $xoopsModuleConfig;
if ($action === false) {
Method b_xfaq_faq
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_xfaq_faq($options)
{
require_once XOOPS_ROOT_PATH . '/modules/xfaq/class/faq.php';
$myts = MyTextSanitizer::getInstance();
Method getanswereForm
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getanswereForm($action = false)
{
global $xoopsDB, $xoopsModuleConfig;
if ($action === false) {
Function getCount
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getCount($criteria = null)
{
$field = '';
$groupby = false;
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
- 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_uninstall_xfaq
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_uninstall_xfaq(XoopsObject $xoopsModule)
{
$module_id = $xoopsModule->getVar('mid');
$module_name = $xoopsModule->getVar('name');
$moduleDirName = $xoopsModule->getVar('dirname');
- 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 checkVerXoops
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function checkVerXoops(XoopsModule $module = null, $requiredVer = null)
{
$moduleDirName = basename(dirname(__DIR__));
if (null === $module) {
$module = XoopsModule::getByDirname($moduleDirName);
Function xfaq_tag_iteminfo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function xfaq_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
Method convertResultSet
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function convertResultSet($result, $id_as_key = false, $as_object = true)
{
$ret = [];
while ($myrow = $this->db->fetchArray($result)) {
$obj = $this->create(false);
Method getprivacyForm
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getprivacyForm($action = false)
{
global $xoopsDB;
if ($action === false) {
Method getCount
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCount($criteria = null)
{
$field = '';
$groupby = false;
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
Method getUserForm
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getUserForm($action = false)
{
global $xoopsDB;
if ($action === false) {
Method getList
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getList($criteria = null, $limit = 0, $start = 0)
{
$ret = [];
if ($criteria == null) {
$criteria = new CriteriaCompo();
Method xfaq_search
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xfaq_search($queryarray, $andor, $limit, $offset, $userid)
{
global $xoopsDB;
global $xoopsDB;