File PagesAdmin.php
has 515 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* PepisCMS
*
Method _getPageEditDefinition
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _getPageEditDefinition($input_groups, $page_id, $site_language)
{
$definition = array();
$definition['page_title'] = array(
'input_group' => $input_groups['document'],
Function _on_page_save_callback
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function _on_page_save_callback(&$data)
{
/*
* TESTS
* Update page contents
- 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 _on_page_save_callback
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _on_page_save_callback(&$data)
{
/*
* TESTS
* Update page contents
PagesAdmin
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class PagesAdmin extends ModuleAdminController
{
/**
* Base path for file uploads
*
Function deletemenuelement
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function deletemenuelement()
{
$item_id = $this->input->getParam('item_id');
$success = 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 _fb_callback_make_filename_seo_friendly
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function _fb_callback_make_filename_seo_friendly(&$filename, $base_path, &$data, $current_image_field_name)
{
// List of the fields to be used, if no value is present for a given key
// then the key will be ignored. By default all values of the keys
// specified will be concatenated
- 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 _fb_callback_make_filename_seo_friendly
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _fb_callback_make_filename_seo_friendly(&$filename, $base_path, &$data, $current_image_field_name)
{
// List of the fields to be used, if no value is present for a given key
// then the key will be ignored. By default all values of the keys
// specified will be concatenated
Method deletemenuelement
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deletemenuelement()
{
$item_id = $this->input->getParam('item_id');
$success = false;
Method menuedit
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function menuedit()
{
$site_language = $this->getAttribute('site_language');
$item_id = $this->input->getParam('item_id');
Method edit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit()
{
$url_suffix = $this->config->item('url_suffix');
$site_language = $this->getAttribute('site_language');
$view = $this->input->getParam('view');
Function _getPageEditDefinition
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function _getPageEditDefinition($input_groups, $page_id, $site_language)
{
$definition = array();
$definition['page_title'] = array(
'input_group' => $input_groups['document'],
- 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 false;
Avoid too many return
statements within this method. Open
return true;
Function _menu_item_name_check
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function _menu_item_name_check($str)
{
if ($this->formbuilder->getId()) {
$item = $this->Menu_model->getById($this->formbuilder->getId(), 'item_name, parent_item_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"