Showing 398 of 4,293 total issues
Function prepareFromModule
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function prepareFromModule()
{
/** @var \Kontentblocks\Modules\Module $fModule */
$fModule = new $this->moduleattrs['class']( $this->getPropertiesObject(), null, $this->environment );
if (!$fModule->fields && !method_exists( $this->module, 'defaultData' )) {
- 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 render
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function render($echo = false)
{
$concater = ConcatContent::getInstance();
if (!is_null($this->path)) {
- 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 createOrGetFieldDataArray
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function createOrGetFieldDataArray($modid, $type, $key, $arrayKey = null)
{
if (!isset($this->fieldData[$type])) {
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public function save($new, $old)
{
$new = array_values($new);
if (is_array($new) && is_array($old)) {
$nc = count($new);
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public function save($new, $old)
{
if (is_array($new) && is_array($old)) {
$nc = count($new);
$oc = count($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 evaluateGroupKey
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function evaluateGroupKey($args, &$key)
{
//check for special key syntax like group::key
if (preg_match("/^(.*?)::/i", $key, $out)) {
if (is_array($out) && count($out) == 2) {
- 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 prepareAttachment
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function prepareAttachment($att)
{
$attachment = null;
if ((is_string($att) && is_numeric($att)) || is_int($att)) {
- 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 recalibrate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
recalibrate: function () {
var winH,
conH,
position,
winDiff;
Function sync
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
sync: function (context) {
var that = this;
KB.Events.trigger('field.before.sync', this.model);
var clone = that.toJSON();
Function createModule
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
createModule: function (module) {
var Area, data;
// check if capability is right for this action
if (Checks.userCan('create_kontentblocks')) {
} else {
Function bindHandlers
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
bindHandlers: function () {
var handlers, checkCounts;
media.view.MediaFrame.Select.prototype.bindHandlers.apply(this, arguments);
Function init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function () {
var that = this;
var $body = $('body');
// init general ui components
this.initTabs();
Method prepareFormValue
has 27 lines of code (exceeds 25 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)) {
Method markVisibility
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function markVisibility(Field $field)
{
$field->setVisibility(true);
$postType = $this->entity->context->get('postType');
Method resize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resize($args = array())
{
if ($this->isSVG) {
$this->src = $this->attachment['url'];
return $this;
Method setupMediaElements
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setupMediaElements()
{
$images = [];
foreach ($this->value['images'] as $k => $attId) {
if (is_numeric($attId['id'])) {
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
// append wrapper element
this.ModuleView.$el.append(tplModuleControls({
model: this.ModuleView.model.toJSON(),
i18n: KB.i18n.jsFrontend
Function geocode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
geocode: function(query, cb, context) {
getJSON(
this.options.serviceUrl + '/address',
{
key: this._key,
Function create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
create: function (ui) {
var Area, data, module;
// check if capability is right for this action
if (Checks.userCan('create_kontentblocks')) {
} else {
Function geocode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
geocode: function(query, cb, context) {
getJSON(
this.options.serviceUrl + '/address',
{
key: this._key,