Showing 398 of 4,293 total issues
Function getAdditionalClasses
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function getAdditionalClasses(Module $module)
{
$classes = array();
$nextHash = null;
- 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 kb-api.php
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Kontentblocks;
use function foo\func;
AbstractEditableFieldReturn
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractEditableFieldReturn implements InterfaceFieldReturn, InterfaceEditableFieldReturn
{
/**
* @var mixed
Function saveModules
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function saveModules($modules)
{
/** @var \Kontentblocks\Modules\Module $module */
foreach ($modules as $module) {
- 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 upscale
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function upscale($default, $orig_w, $orig_h, $dest_w, $dest_h, $crop)
{
if (!$crop) {
return null;
} // Let the wordpress default function handle this.
- 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 compare
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function compare($first, $group = null, $groups, $value)
{
if (is_null($group)) {
$group = [
'start' => $first['day'],
- 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 success
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: function (res) {
// clear form content
that.$inner.empty();
// clear fields on ModuleView
that.ModuleView.clearFields();
Kontentblocks
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Class Kontentblocks
{
const VERSION = '0.12.3';
const DEVMODE = true;
ModuleStorage
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class ModuleStorage implements \Countable
{
/**
* current post id
* @var int
AreaRegistry
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class AreaRegistry
{
/**
* All register areas
PostEnvironment
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class PostEnvironment implements JsonSerializable, EnvironmentInterface
{
/**
* generic low-level data handler
Function openFrame
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
openFrame: function (editmode) {
var that = this, metadata, frameoptions;
if (this.frame) {
this.frame.dispose();
}
Function openFrame
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
openFrame: function (editmode) {
var that = this, metadata;
if (this.frame) {
this.frame.dispose();
}
Method markVisibility
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function markVisibility(Field $field)
{
$field->setVisibility(true);
$areaContext = $this->entity->getContext()->get('areaContext');
Method getAdditionalClasses
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAdditionalClasses(Module $module)
{
$classes = array();
$nextHash = null;
Function areasForContext
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function areasForContext($postId = null, $context)
{
global $post;
$postId = (null === $postId) ? $post->ID : $postId;
$environment = Utilities::getPostEnvironment($postId);
- 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 markVisibility
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function markVisibility(Field $field)
{
$field->setVisibility(true);
$areaContext = $this->entity->getContext()->get('areaContext');
- 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 prepareFormValue
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function prepareFormValue($val)
{
if (is_numeric($val)) {
return filter_var($val, FILTER_SANITIZE_NUMBER_INT);
} else if (is_string($val)) {
- 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 save
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function save($data, $old)
{
if (is_null($data)) {
return $old;
}
- 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 setupItems
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function setupItems()
{
if (!empty($this->items)) {
return $this->items;
}
- 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"