Showing 486 of 487 total issues
File Siteconfig_model.php
has 369 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* PepisCMS
*
Function edit
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function edit()
{
$section = $this->input->getParam('section');
$is_editable = ($section != 'system' && !$this->Module_model->isCoreModule($section)) || !PEPISCMS_PRODUCTION_RELEASE;
- 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 generateExcel
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateExcel($feed, $headers = false, $file_name = false, $send = true, $print_headers = true, $excel_type = Spreadsheet::EXCEL_XLS)
{
if (!$this->isFullyEnabled()) {
throw new \RuntimeException("PhpSpreadsheet is not enabled. Please refer to README.md");
}
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 theme
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function theme()
{
$this->load->library('Google_chart_helper');
$this->load->library('FormBuilder');
Function redrawTable
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
function redrawTable(_path) {
window.location.hash = '#' + _path;
//$(".path").html('<strong>'+label_loading_list_of_files+'</strong>');
$("#filemanager_grid").attr('disabled', 'disabled');
File Cms_usersAdmin.php
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* PepisCMS
*
Function loadForModule
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function loadForModule($langfile = '', $idiom = '', $return = false, $module_name = false)
{
// TODO Remove this hack
$langfile = str_replace('.php', '', str_replace('_lang.', '', $langfile)) . '_lang.php';
- 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_on_save
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function _fb_callback_on_save(&$data)
{
$user_id = $this->formbuilder->getId();
if (!$data['birth_date'] || $data['birth_date'] = '0000-00-00') {
- 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
File ajaxfilemanager.js
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
function FileManagerUI(transtlation_map, is_intranet) {
var current_path = '/';
var parent_path = '';
var allowed_extensions = []; // Must be an array
User_model
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class User_model extends Generic_model
{
/**
* Minimum minimum allowed length of the password
Method getDefinitionFromTable
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDefinitionFromTable($table, $resolve_fk = true)
{
$collumns_a = $this->getTableRawDescription($table);
if (!$collumns_a) {
return false;
Function isAuthenticated
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function isAuthenticated($force_do_all_checks_again = false)
{
if (!$force_do_all_checks_again) {
if ($this->is_authenticated !== null) {
// Kind of cache
- 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_on_import
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _fb_callback_on_import($data_array)
{
$this->load->library('Spreadsheet');
$this->load->helper('url');
Document
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class Document extends ContainerAware
{
/** @var int */
private $id;
/** @var string */
Method makeUserSpaceModule
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function makeUserSpaceModule($module_database_table_name,
$module_name,
$auto_install = true,
$parse_database_schema = true,
$database_group = false,
Function menurendor_render_submenu
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function menurendor_render_submenu($menu_items, $level = 1)
{
$prefix = "\t";
for ($i = 0; $i < $level; $i++) {
$prefix .= "\t";
- 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 index
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index($display_view = true)
{
$running_module = $this->getAttribute('running_module');
$definition = $this->getDefinition();
File Module.php
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* PepisCMS
*