Showing 115 of 162 total issues
Function draw_repost_form
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function draw_repost_form(string $area = '' ) {
// Notify which file is broken
if ( headers_sent() ) {
restore_error_handler();
- 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 diff
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function diff( $from_lines, $to_lines ) {
$xhash = [];
$yhash = [];
$n_from = is_countable($from_lines) ? count( $from_lines ) : 0;
$n_to = is_countable($to_lines) ? count( $to_lines ) : 0;
Function triggerEvent
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function triggerEvent($mydirname, $mytrustdirname, $category, $item_id, $event, array $extra_tags = [], array $user_list = [], $omit_user_id = null)
{
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname($mydirname);
- 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 _diag
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _diag( $xoff, $xlim, $yoff, $ylim, $nchunks ) {
$ymatches = [];
$ymids = [];
$seps = [];
$flip = false;
Method _shiftBoundaries
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _shiftBoundaries( $lines, &$changed, $other_changed ) {
$i = 0;
$j = 0;
assert( (is_countable($lines) ? count( $lines ) : 0) == count( $changed ) );
Method renderCell4BlockPosition
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderCell4BlockPosition( $block_data ) {
$bid = (int) $block_data['bid'];
$side = (int) $block_data['side'];
$visible = (int) $block_data['visible'];
Method list_blocks
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function list_blocks() {
$handler = null;
global $xoopsGTicket;
// main query
Method altsys_admin_in_theme_in_last
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function altsys_admin_in_theme_in_last( $contents = null ) {
$xoopsTpl = null;
global $xoops_admin_contents, $xoopsConfig, $xoopsModule, $xoopsUser, $xoopsUserIsAdmin, $xoopsLogger, $altsysModuleConfig, $altsysModuleId;
if ( ! isset( $contents ) ) {
Method render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render() {
global $xoopsGTicket;
// load all child ids for javascript codes
foreach ( array_keys( $this->_itemTree ) as $item_id ) {
Method check
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function check(bool $post = true, string $area = '', bool $allow_repost = true ) {
global $xoopsModule;
$this->_errors = [];
Method altsys_onupdate_base
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function altsys_onupdate_base( $module, $mydirname ) {
// transactions on module update
global $msgs; // TODO :-D
Method update_block
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update_block( $bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $options = [] ) {
global $xoopsConfig;
//HACK by domifara
if ( defined( 'XOOPS_CUBE_LEGACY' ) ) {
Method read
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function read($resource, $mydirname, $mytrustdirname = null, bool $read_once = true)
{
$d3file = XOOPS_ROOT_PATH . '/modules/' . $mydirname . '/mytrustdirname.php';
if (empty($mytrustdirname) && is_file($d3file)) {
Function altsys_mylangadmin_get_constant_names
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function altsys_mylangadmin_get_constant_names( $langfile_unique_path, $mydirname ) {
$constpref = '';
$langfile_names = [];
- 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 render
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render( $diff ) {
$x0 = null;
$y0 = null;
$xi = $yi = 1;
$block = false;
Function extract_post_recursive
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function extract_post_recursive( $key_name, $tmp_array ) {
$table = '';
$form = '';
- 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 issue
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function issue(string $salt = '', int $timeout = 1800, string $area = '' ) {
global $xoopsModule;
if ( '' === $salt ) {
if ( version_compare( PHP_VERSION, '7.0.0' ) >= 0 && function_exists( 'random_bytes' ) ) {
- 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 _compareseq
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function _compareseq( $xoff, $xlim, $yoff, $ylim ) {
$seps = [];
/* Slide down the bottom initial diagonal. */
while ( $xoff < $xlim && $yoff < $ylim
&& $this->xv[ $xoff ] == $this->yv[ $yoff ] ) {
- 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 altsys_admin_in_theme_in_last
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function altsys_admin_in_theme_in_last( $contents = null ) {
$xoopsTpl = null;
global $xoops_admin_contents, $xoopsConfig, $xoopsModule, $xoopsUser, $xoopsUserIsAdmin, $xoopsLogger, $altsysModuleConfig, $altsysModuleId;
if ( ! isset( $contents ) ) {
- 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 do_clone
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function do_clone( $bid ) {
$handler = null;
$bid = (int) $bid;
$request = $this->fetchRequest4Block( $bid );