Showing 398 of 4,293 total issues
Module
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Module implements EntityInterface, FieldEntityInterface
{
/**
* Module Properties Object
Function onAdd
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
onAdd: function(map) {
var className = 'leaflet-control-geocoder',
container = L.DomUtil.create('div', className + ' leaflet-bar'),
icon = L.DomUtil.create('button', className + '-icon', container),
form = (this._form = L.DomUtil.create('div', className + '-form', container)),
Function Utilities
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
var Utilities = function ($) {
return {
// store with expiration
stex: {
set: function (key, val, exp) {
- 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 localize
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
private static function localize()
{
//Caps for the current user as global js object
$current_user = wp_get_current_user();
- 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 restoreBackup
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function restoreBackup($backupId)
{
if (!apply_filters('kb.backups.enabled', '__return_true')) {
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 onAdd
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
onAdd: function(map) {
var className = 'leaflet-control-geocoder',
container = L.DomUtil.create('div', className + ' leaflet-bar'),
icon = L.DomUtil.create('button', className + '-icon', container),
form = (this._form = L.DomUtil.create('div', className + '-form', container)),
Function filterForPost
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function filterForPost(PostEnvironment $environment)
{
$pageTemplate = $environment->getPageTemplate();
$postType = $environment->getPostType();
- 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
Utilities
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class Utilities
{
protected static $postEnvironments = array();
protected static $termEnvironments = array();
Function fillArrayWithFileNodes
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function fillArrayWithFileNodes($dir, $root)
{
$data = array();
$dir = new DirectoryIterator($dir);
foreach ($dir as $node) {
- 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 StandardFieldSection.php
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Kontentblocks\Fields;
use Exception;
File DynamicAreas.php
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Kontentblocks\Backend\Dynamic;
use Kontentblocks\Areas\AreaProperties;
StandardFieldSection
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class StandardFieldSection implements ExportableFieldInterface
{
/**
* Preset defaults
File Module.php
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Kontentblocks\Modules;
File kontentblocks.php
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
Plugin Name: Kontentblocks
Plugin URI: https://github.com/kai-jacobsen/kontentblocks
Description: Content modularization framework
Method registerScripts
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function registerScripts()
{
$folder = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? 'dev' : 'dist';
$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
$version = Kontentblocks::VERSION;
File UI.js
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
*
* These is a collection of helper functions to handle
* the user interface / user interaction such as
* - Sorting
Function render
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (reload) {
var that = this,
json;
Logger.User.info('Frontend modal retrieves data from the server');
json = this.model.toJSON();
File Enqueues.php
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Kontentblocks\Hooks;
use Kontentblocks\Kontentblocks;
Function init
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function (modalView) {
if (!wp || !wp.media) {
return;
}
exports
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
module.exports = Backbone.View.extend({
tagName: 'div',
id: 'onsite-modal',
timerId: null,
viewStack: {},