Showing 398 of 4,293 total issues
Function send
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
send: function (data, callback, scope, options) {
var pid;
var addPayload = options || {};
if (data.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 init
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function init()
{
if (is_admin()) {
$postType = $this->environment->getPostType();
if (function_exists('get_current_screen')) {
- 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 parseOverrides
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function parseOverrides($overrides)
{
$whitelist = array('name', 'loggedinonly', 'wrapperclasses');
foreach ($overrides as $key => $value) {
- 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 getTemplatesforContext
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getTemplatesforContext(ModuleContext $context)
{
$collection = array();
$collection += $this->getSingles($this->views);
$areaContext = $context->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 get
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function get($key, $default = null, $group = null)
{
$value = $default;
$isPrivate = 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 render
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function render($echo)
{
$concater = ConcatContent::getInstance();
if (!$this->validate()) {
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 initialize
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function () {
// Setup Elements
this.open = false;
if (this.model.get('globalModule') === true) {
this.open = true;
Method setupSettings
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setupSettings($file, $classname)
{
$args = Module::getDefaultSettings();
if (property_exists($classname, 'settings')) {
Function MediaWorkflow
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
KB.Utils.MediaWorkflow = function (args) {
var _frame, options;
var defaults = {
buttontext: 'Buttontext',
Function geocode
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
geocode: function(query, cb, context) {
var params = this.options.geocodingQueryParams;
if (
params.proximity !== undefined &&
params.proximity.lat !== undefined &&
Method filterForPost
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function filterForPost(PostEnvironment $environment)
{
$pageTemplate = $environment->getPageTemplate();
$postType = $environment->getPostType();
Function ViewsCollection
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
KB.ViewsCollection = function () {
this.views = {};
this.lastViewAdded = null;
this.add = function (id, view) {
if (!this.views[id]) {
Method action
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function action(Request $request)
{
$delete = false;
$data = $request->request->get('data');
$target = filter_var($data['targetPid'], FILTER_SANITIZE_NUMBER_INT);
Function factorNewItem
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
factorNewItem: function (data, obj) {
var uid = obj['_meta'].uid || null;
var title = obj['_meta'].title || null;
var type = obj['_meta'].type;
var status = obj['_meta'].status || 'visible';
Function _keydown
has 40 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 getCoreActions
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getCoreActions()
{
return apply_filters(
'kb.ajax.core.actions',
array(
Method addField
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addField($type, $key, $args = array())
{
if (is_string($key) && empty($key)) {
return $this;
Function getFieldData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
getFieldData: function (type, moduleId, key, arrayKey) {
var typeData;
if (this._typeExists(type)) {
typeData = KB.payload.fieldData[type];
// no data for module 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 addByFile
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function addByFile($file)
{
include_once $file;
$classname = str_replace('.php', '', basename($file));
$modelArg = '';
- 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 saveModules
has a Cognitive Complexity of 13 (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"