Showing 4,293 of 4,293 total issues
Function maybeRemoveAreas
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function maybeRemoveAreas()
{
if ($this->isDirty && isset($_GET['kb-clean-me-up']) && $_GET['kb-clean-me-up'] === 'yeah') {
foreach ($this->removedAreas as $id) {
$posts = get_posts(
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
protected static function action(Request $request)
{
$postId = $request->request->getInt('postId', null);
$data = $request->request->get('data');
- 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 auth
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function auth()
{
$all = $this->postdata->request->all();
// verify if this is an auto save routine.
// If it is our form has not been submitted, so we dont want to do anything
- 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 getFormFilter
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getFormFilter($fielddata)
{
$collect = array();
if (!empty($fielddata)) {
foreach ($fielddata as $k => $v) {
- 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 setupModules
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function setupModules()
{
$collection = array();
$json = array();
$data = $this->slotConfig;
- 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 prepareValue
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function prepareValue($value)
{
if (!is_array($value)) {
return $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 extractFieldsFromConfig
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function extractFieldsFromConfig()
{
if (!is_array($this->types)) {
return 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 getFormFilter
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getFormFilter( $fielddata )
{
$collect = array();
if (!empty( $fielddata )) {
foreach ($fielddata as $k => $v) {
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public function save($data, $old)
{
if (is_null($data)) {
return $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 save
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function save($new, $old)
{
$new = array_values($new);
if (is_array($new) && is_array($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
Method setupModule
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setupModule($module)
{
/** @var \Kontentblocks\Modules\ModuleRegistry $moduleRegistry */
$moduleRegistry = Kontentblocks::getService('registry.modules');
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
var $source, $target, $sourcecontainer, $targetcontainer;
var that = this;
this.$('.kbml-slot').draggable({
revert: 'invalid',
Function draggable
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
draggable: function () {
var $source, $target, $sourcecontainer, $targetcontainer;
var that = this;
this.$('.kbml-slot').draggable({
revert: 'invalid',
Function reverse
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
reverse: function(location, scale, cb, context) {
var params = {
key: this._accessToken,
q: [location.lat, location.lng].join(',')
};
Function geocode
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
geocode: function(query, cb, context) {
var params = {
key: this._accessToken,
q: query
};
Method duplicate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function duplicate()
{
global $post;
$post = get_post(self::$postId);
setup_postdata($post);
Method globalModule
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function globalModule($gmodule)
{
global $post;
if (empty($gmodule)) {
wp_die('no template arg provided');
Method enqueueScripts
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function enqueueScripts()
{
global $post;
$post_id = ( !empty( $post->ID ) ) ? $post->ID : null;
Method prepareTemplateData
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareTemplateData($data)
{
$options = $this->getArg('options', []);
if (is_callable($options)) {
$options = call_user_func($options, $this);
Function update
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function (ev, ui) {
if (!isValidModule()) {
return false;
}