Showing 153 of 181 total issues
File GwikiPage.php
has 1739 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace XoopsModules\Gwiki;
use const _MI_GWIKI_WIKI404;
Function showDOMNode
has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring. Open
function showDOMNode(&$out, DOMNode $domNode, $nest, $lt, $ld, $nop)
{
foreach ($domNode->childNodes as $node) {
switch ($node->nodeName) {
case 'a':
- 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 wizard.php
has 631 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* wizard.php - wiki page creation wizard
*
* @copyright Copyright © 2013 geekwright, LLC. All rights reserved.
GwikiPage
has 67 functions (exceeds 20 allowed). Consider refactoring. Open
class GwikiPage
{
//------------------------------------------------------------
// Properties - public, protected, and private
//------------------------------------------------------------
File prefixes.php
has 514 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* admin/prefixes.php - manage wiki namespaces
*
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
Method showAttachments
has 189 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showAttachments()
{
global $xoopsDB, $wikiPage;
$dir = \basename(\dirname(__DIR__));
/*
File pages.php
has 472 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* admin/pages.php - manage wiki page revision
*
* @copyright Copyright © 2013 geekwright, LLC. All rights reserved.
Method __construct
has 182 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($wordsPer = 100)
{
$this->wordsPerParagraph = $wordsPer;
$this->wordsPerSentence = 24.460;
$this->words = [
Method showDOMNode
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showDOMNode(&$out, DOMNode $domNode, $nest, $lt, $ld, $nop)
{
foreach ($domNode->childNodes as $node) {
switch ($node->nodeName) {
case 'a':
File blocks.php
has 449 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* blocks/blocks.php
*
* @param mixed $options
Method renderPage
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderPage($body = null, $title = null)
{
if (empty($body)) {
$body = $this->body;
}
Function checkEdit
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
public function checkEdit()
{
global $xoopsUser, $xoopsDB;
$mayEdit = 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 xoops_module_update_gwiki
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_update_gwiki(\XoopsModule $module, $old_version)
{
global $xoopsDB;
$error = false;
Function renderLists
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
private function renderLists($matches)
{
$lines = \explode("\n", $matches[0]);
$last = '';
foreach ($lines as $i => $line) {
- 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 fbcom_plugin
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
function fbcom_plugin(&$metas, $plugin_env)
{
global $xoopsDB;
$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 addRevision
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function addRevision($leave_inactive = false)
{
global $xoopsDB;
$page = $this->escapeForDB($this->keyword);
- 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_update_gwiki
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_update_gwiki(\XoopsModule $module, $old_version)
{
global $xoopsDB;
$error = 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 addRevision
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addRevision($leave_inactive = false)
{
global $xoopsDB;
$page = $this->escapeForDB($this->keyword);
File LoremIpsumGenerator.php
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// from http://snipplr.com/view.php?codeview&id=66113
//if(!defined('BASEPATH'))
// exit('No direct script access allowed');