Showing 53 of 53 total issues
Avoid too many return
statements within this method. Open
return __('Not Found', 'sage');
Avoid too many return
statements within this method. Open
return get_the_title();
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return new AboutMetaGenerator(
$post,
\CustomPageManager::getAboutPage()->getPage()
);
Avoid too many return
statements within this method. Open
return new GenericMetaGenerator($post);
Avoid too many return
statements within this method. Open
return new AboutIndexCustomFields(
$attributes,
\CustomPageManager::getAboutPage()->getPage()
);
Avoid too many return
statements within this method. Open
return new NoOpIndexCustomFields($attributes);
Function getAllTagPairs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getAllTagPairs(): /* array<Pair>*/ array {
$flat_list = array();
foreach(OpenGraphMetaCategory::getList() as $category) {
$pairs = $this->getTagPairs($category);
if (!$pairs) {
- 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 getAllTagPairs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getAllTagPairs(): /* array<Pair>*/ array {
$flat_list = array();
foreach(MetaMetaCategory::getList() as $category) {
$pairs = $this->getTagPairs($category);
if (!$pairs) {
- 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 getPDFGuideSize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getPDFGuideSize(): ?string {
if (!$this->guidePDF || !$this->guidePDF['url']) {
return null;
}
- 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 getOGPImage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getOGPImage(): array {
$image = null;
if ($this->post) {
switch($this->post->post_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
Function getPath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getPath($key = '', $default = null) {
$collection = $this->manifest;
if (is_null($key)) {
return $collection;
}
- 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 body_class
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function body_class($classes) {
// Add page slug if it doesn't exist
if (is_single() || is_page() && !is_front_page()) {
if (!in_array(basename(get_permalink()), $classes)) {
$classes[] = basename(get_permalink());
- 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"