Showing 29 of 53 total issues
Method _registerCustomMetaBox
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _registerCustomMetaBox() {
$custom_boxes_init = function() {
// Custom Guides meta box
$cmb_guide = new_cmb2_box(array(
'id' => 'galerie_foto_ghiduri',
FirstAid
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
final class FirstAid extends Entity {
private $arsuraCopii;
private $apel112;
private $intoxicatieAlcoolica;
private $muscaturiAnimal;
Guide
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
final class Guide extends Entity {
private $title;
private $nume;
private $inainteaEvenimentului;
private $inTimpulEvenimentului;
PersonalPlan
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
final class PersonalPlan extends Entity {
private $apa;
private $alimente;
private $imbracaminteSiIncaltaminte;
private $sacDeDormit;
Method getPDFGuideSize
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPDFGuideSize(): ?string {
if (!$this->guidePDF || !$this->guidePDF['url']) {
return null;
}
Function cssTasks
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
var cssTasks = function(filename) {
return lazypipe()
.pipe(function() {
return gulpif(!enabled.failStyleTask, plumber());
})
Method getPage
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPage(): FirstAid {
return (new FirstAid($this->wpObject->ID))
->setArsuraCopii(get_field('arsura_la_copii', $this->wpObject->ID))
->setIntoxicatiaAlcoolica(
get_field('intoxicatia_alcoolica', $this->wpObject->ID)
Method _registerCustomPostTypes
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _registerCustomPostTypes() {
register_post_type(App::POST_TYPE_CAMPAIGN,
array(
'labels' => array(
'name' => __('Campanii'),
Method getPage
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPage(): PersonalPlan {
return (new PersonalPlan($this->wpObject->ID))
->setApa(get_field('apa', $this->wpObject->ID))
->setAlimente(get_field('alimente', $this->wpObject->ID))
->setImbracaminteSiIncaltaminte(
Method get
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public static function get(
?WP_Post $post
): MetaGenerator {
if (!$post) {
return new GenericMetaGenerator($post);
Function getAll
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
final public function getAll(): array {
$all_tags = array();
$custom_tags = $this->copyAllCommonTags($this->getCustomTags());
$default_tags = $this->getDefaultTags();
- 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 render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(): void {
$handler = opendir($this->guidePath);
$custom_css = $this->customCSS();
add_action(
Method get
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public static function get(
WP_Post $post,
array $attributes = array()
): IndexCustomFields {
switch ($post->post_type) {
Function title
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function title() {
if (is_home()) {
if (get_option('page_for_posts', true)) {
return get_the_title(get_option('page_for_posts', true));
} else {
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
public function render(): void {
$handler = opendir($this->guidePath);
$custom_css = $this->customCSS();
add_action(
- 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 new PersonalPlanMetaGenerator(
$post,
\CustomPageManager::getPersonalPlanPage()->getPage()
);
Avoid too many return
statements within this method. Open
return get_the_title();
Avoid too many return
statements within this method. Open
return __('Not Found', 'sage');
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 AboutIndexCustomFields(
$attributes,
\CustomPageManager::getAboutPage()->getPage()
);