Showing 21 of 289 total issues
Function populateDefaultValues
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
protected static function populateDefaultValues($options)
{
if (!$options) {
$options = array();
}
- 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 show
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show()
{
?>
<div class="wrap">
Function parseOptions
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
parseOptions: function(f, code) {
var matches = code.match(/(\s*)\[cc([^\s\]_]*(?:_[^\s\]]*)?)([^\]]*)\](.*?)\[\/cc\2\](\s*)/);
if (matches) {
var options = matches[3].split(/\s+/);
for (var i = options.length; i--; ) {
- 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 performHighlightGeshi
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
private function performHighlightGeshi($content, $options)
{
/* Geshi configuration */
if (!$this->geshi) {
$this->geshi = new GeSHi();
- 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 codecolorer-core.php
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
CodeColorer plugin core part
https://kpumuk.info/projects/wordpress-plugins/codecolorer
*/
Method populateDefaultValues
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function populateDefaultValues($options)
{
if (!$options) {
$options = array();
}
Method performHighlightGeshi
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function performHighlightGeshi($content, $options)
{
/* Geshi configuration */
if (!$this->geshi) {
$this->geshi = new GeSHi();
Method performHighlightCodeBlock
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function performHighlightCodeBlock($text, $opts, $content, $suffix = '', $before = '', $after = '')
{
// Parse options
$options = CodeColorerOptions::parseOptions($opts, $suffix);
Function insert
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
insert: function() {
var ed = tinyMCEPopup.editor, t, h, f = document.forms[0], st = '';
t = 'cce'
- 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 insert
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
insert: function() {
var ed = tinyMCEPopup.editor, t, h, f = document.forms[0], st = '';
t = 'cce'
Method enable
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function enable()
{
$path = dirname(__FILE__);
if (!file_exists("$path/codecolorer-core.php")) {
return false;
Function getInstance
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function &getInstance()
{
static $instance = null;
if (null === $instance) {
- 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 performHighlightCodeBlock
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function performHighlightCodeBlock($text, $opts, $content, $suffix = '', $before = '', $after = '')
{
// Parse options
$options = CodeColorerOptions::parseOptions($opts, $suffix);
- 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 parseOptions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function parseOptions($opts, $suffix = '')
{
$opts = str_replace(array("\\\"", "\\\'"), array ("\"", "\'"), $opts);
preg_match_all('#([a-z_-]*?)\s*=\s*(["\'])(.*?)\2#i', $opts, $matches, PREG_SET_ORDER);
$options = array();
Function parseOptions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseOptions: function(f, code) {
var matches = code.match(/(\s*)\[cc([^\s\]_]*(?:_[^\s\]]*)?)([^\]]*)\](.*?)\[\/cc\2\](\s*)/);
if (matches) {
var options = matches[3].split(/\s+/);
for (var i = options.length; i--; ) {
Function addContainer
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function addContainer($html, $options, $numLines)
{
$customCSSClass = empty($options['class']) ? '' : ' ' . $options['class'];
if ($options['inline']) {
$theme = empty($options['inline_theme']) ? 'default' : $options['inline_theme'];
- 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 beforeHighlightCodeBlock
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function beforeHighlightCodeBlock($content)
{
$helper = $this;
$content = preg_replace_callback(
Method addContainer
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addContainer($html, $options, $numLines)
{
$customCSSClass = empty($options['class']) ? '' : ' ' . $options['class'];
if ($options['inline']) {
$theme = empty($options['inline_theme']) ? 'default' : $options['inline_theme'];
Function parseOptions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function parseOptions($opts, $suffix = '')
{
$opts = str_replace(array("\\\"", "\\\'"), array ("\"", "\'"), $opts);
preg_match_all('#([a-z_-]*?)\s*=\s*(["\'])(.*?)\2#i', $opts, $matches, PREG_SET_ORDER);
$options = array();
- 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 performHighlightCodeBlock
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function performHighlightCodeBlock($text, $opts, $content, $suffix = '', $before = '', $after = '')