Showing 21 of 59 total issues
Function getACF
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getACF($key = null, $format = true)
{
if (!function_exists('acf_format_value')) {
throw new UnsatisfiedDependencyException('Advanced Custom Fields must be installed to use field');
}
- 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
Post
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Post extends Model
{
use Rememberable;
public $timestamps = false;
Function query
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function query($query)
{
if (!$this->ready) {
$this->check_current_query = true;
- 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 query
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function query($query)
{
if (!$this->ready) {
$this->check_current_query = true;
Method getACF
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getACF($key = null, $format = true)
{
if (!function_exists('acf_format_value')) {
throw new UnsatisfiedDependencyException('Advanced Custom Fields must be installed to use field');
}
Function __
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function __($key, $replace = [], $locale = null)
{
if (is_array($replace)) {
try {
return app('translator')->getFromJson($key, $replace, $locale);
- 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 acf
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function acf($page = null, $name = null, $format = true)
{
if (!function_exists('acf_format_value')) {
throw new UnsatisfiedDependencyException('Advanced Custom Fields must be installed to use field');
}
Function acf
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function acf($page = null, $name = null, $format = true)
{
if (!function_exists('acf_format_value')) {
throw new UnsatisfiedDependencyException('Advanced Custom Fields must be installed to use field');
}
- 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 __call
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __call($name, $arguments)
{
$name = Str::snake($name);
$name = str_replace('has', 'have', $name);
- 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 addPage
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function addPage($pageTitle, $menuTitle, $capability, $slug, $action, $iconUrl = '', $position = null)
Function _do_query
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function _do_query($query)
{
if (defined('SAVEQUERIES') && SAVEQUERIES) {
$this->timer_start();
}
- 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 addSubpage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function addSubpage($parent, $pageTitle, $menuTitle, $capabilities, $slug, $action)
Function get
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function get($page = null, $name = null)
{
if (is_object($page) && (is_subclass_of($page, Post::class) || $page instanceof Post)) {
$page = $page->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
Method wp_mail
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function wp_mail($to, $subject, $message, $headers = '', $attachments = [])
Function wp_mail
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function wp_mail($to, $subject, $message, $headers = '', $attachments = [])
{
list($to, $subject, $headers, $attachments) = array_values(
Action::filter('wp_mail', [$to, $subject, $message, $headers, $attachments])
);
- 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 add
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function add($key, $value, $group = 'default', $expiration = 0)
{
if (wp_suspend_cache_addition()) {
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
Avoid too many return
statements within this method. Open
return static::getCache($group)->add($this->buildKey($group, $key), $value, $expiration / 60);
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return "<?php gravity_form({$expression}); ?>";