Showing 398 of 4,293 total issues
Method editor
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
static public function editor($id, $data, $name = null, $media = false, $args = array())
Method registerFieldData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function registerFieldData($modid, $type, $data, $key, $arrayKey)
Method getField
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getField($type, $baseId, $subkey, $key, $args = array())
Function getFieldArgs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getFieldArgs: function (id, key) {
if (KB.payload.Fields && KB.payload.Fields[id]) {
if (key && KB.payload.Fields[id][key]) {
return KB.payload.Fields[id][key];
} else {
- 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 getSlotModule
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getSlotModule: function (slotId) {
var value = this.model.get('value').modules || {};
var module = value[slotId];
if (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 prepareModel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function prepareModel()
{
$savedData = $this->model->export();
if ($this->fields) {
$data = 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
Function findDefaultTemplate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function findDefaultTemplate()
{
$keys = array_values($this->views);
if (method_exists($this->module, 'defaultView')) {
$setByModule = $this->module->defaultView();
- 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 deleteModule
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function deleteModule(Module $module)
{
if ($module->properties->globalModule) {
$parentId = $module->properties->parentObjectId;
$meta = get_post_meta($parentId, '_kb_attached_to', true);
- 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 MediaWorkflow
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
KB.Utils.MediaWorkflow = function (args) {
var _frame, options;
var defaults = {
buttontext: 'Buttontext',
- 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 setupUtilities
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function setupUtilities()
{
$this->services['utility.logger'] = function ($container) {
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
public function save($postId, $postObj)
{
// mic check one two, one two
if ($this->auth() === 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
Function create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function create()
{
if (is_array( $this->getDefinitionArray() ) && !$this->isLocked()) {
$update = $this->environment->getStorage()->addToIndex( $this->createModuleId(), $this->moduleattrs );
if (!is_null( $this->newData )) {
- 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 addArea
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function addArea($args, $manual = true)
{
if (!empty($args['id'])) {
$args['id'] = sanitize_title($args['id']);
}
- 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 action
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected static function action(Request $request)
{
$postId = $request->request->getInt('postId', null);
$environment = Utilities::getPostEnvironment($postId);
$storage = $environment->getStorage();
- 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 prepareModel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function prepareModel()
{
$savedData = $this->model->export();
if ($this->fields) {
$data = 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
Function setupDiff
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function setupDiff()
{
$trans = get_transient('kb_dynamic_areas');
if (!$trans) {
- 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 hasModules
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function hasModules($area)
{
if (!empty($this->index)) {
foreach ($this->index as $module) {
if ($module->area->id === $area && $module['draft'] !== 'true' && $module['active'] !== 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
Function save
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function save($postId, \WP_Post $postObj)
{
// auth request
if (!$this->auth($postId)) {
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
Function addString
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function addString($string)
{
if (!is_string($string)) {
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
Function prepareModel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function prepareModel()
{
$savedData = $this->model->export();
$model = $this->model;
if ($this->fields) {
- 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"