Showing 398 of 4,293 total issues
Function getFrontendValue
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getFrontendValue($salt = null)
{
if (!is_null($this->userValue)) {
return $this->userValue;
- 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 Config
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Config = (function ($) {
var config = KB.appData.config || {};
return {
/**
* General getter
Method connect
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function connect($classname, $args)
{
$setting = $args['settings']['connect'];
$postTypes = get_post_types_by_support('kontentblocks');
if (empty($setting)) {
Function moduleUpdated
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
moduleUpdated: function (res, b, c, save, notice) {
var that = this;
that.model.trigger('modal.serialize.before');
Method action
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function action(Request $request)
{
$module = wp_unslash($request->request->get('module'));
$tplName = wp_unslash($request->request->get('filename', ''));
$environment = Utilities::getPostEnvironment($module['postId']);
Method render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($echo)
{
$concater = ConcatContent::getInstance();
if (!$this->validate()) {
return false;
Function initialSetup
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialSetup: function () {
var data, types;
data = this.model.get('value'); // model equals FieldControlModel, value equals parent obj data for this field key
types = this.model.get('fields');
Function setupMap
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
setupMap: function () {
var that = this;
this.map = L.map(this.uniq).setView([53.551086, 9.993682], 15);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
Method save
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save($data, $old)
{
if (is_null($data)) {
return $old;
}
Function geocode
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
geocode: function(query, cb, context) {
var params = this.options.geocodingQueryParams;
if (
typeof params.proximity !== 'undefined' &&
params.proximity.hasOwnProperty('lat') &&
Function geocode
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
geocode: function(query, cb, context) {
var params = {
SingleLine: query,
outFields: 'Addr_Type',
forStorage: false,
Function send
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
send: function (data, callback, scope, options) {
var pid;
var addPayload = options || {};
if (data.postId) {
Function initialize
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function () {
if (!this.options.cropOptions) {
this.options.cropOptions = {};
}
this.options.cropOptions = _.defaults(this.options.cropOptions, {
Function applyClasses
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
applyClasses: function () {
var $parent, prev;
var $modules = this.model.View.$el.find('.module');
$modules.removeClass('first-module last-module repeater');
for (var i = 0; i < $modules.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 renderContext
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function renderContext($context, $postId, $areaSettings = array(), $moduleSettings = array())
{
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 setupSettings
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function setupSettings($file, $classname)
{
$args = Module::getDefaultSettings();
if (property_exists($classname, 'settings')) {
- 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 _keydown
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_keydown: function(e) {
var _this = this,
select = function select(dir) {
if (_this._selection) {
L.DomUtil.removeClass(_this._selection, 'leaflet-control-geocoder-selected');
Method createGlobalModule
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createGlobalModule($postId, \WP_Post $post, PostEnvironment $environment)
{
$value = Utilities::getRequest();
Method handleUpload
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function handleUpload()
{
header( 'Content-Type: text/html; charset=UTF-8' );
if (!defined( 'DOING_AJAX' )) {
Function reverse
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
reverse: function(location, scale, cb, context) {
getJSON(
this.options.serviceUrl +
encodeURIComponent(location.lng) +
',' +