Showing 482 of 487 total issues
Function display
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function display($view = false, $display_header = true, $display_footer = true, $return = false)
{
$return_html = true;
if ($this->already_displayed && !$return) {
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
Function revision
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function revision()
{
$id = $this->input->getParam('id');
$revision_id = $this->input->getParam('revision_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
Function fix_missing_translation_files
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function fix_missing_translation_files()
{
$languages = array_keys($this->config->item('languages'));
$modules = $this->Module_model->getInstalledModulesNames();
- 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 PageEditorUI
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PageEditorUI(translation_map) {
var label_unsaved_changes = "All unsaved changes will be lost. Proceed?";
this.init = function () {
Method hasAccess
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function hasAccess($controller, $method = false, $module = false)
{
if (!$method) {
$method = 'index';
}
Method localizeDefinition
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function localizeDefinition(&$definition, TranslateableInterface $object)
{
$this->load->model('Site_language_model');
$languages = $this->Site_language_model->getLanguages();
if (count($languages) == 1) {
Method drawSimpleColumnChart
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function drawSimpleColumnChart($data_feed, $collumn1_desc = '', $collumn2_desc = '', $width = 1200, $height = 200, $max_value = 10, $column1_data_type = "string", $column2_datatype = "number")
{
$id = $this->generateId('column_chart');
$out = $this->includeJavaScripts();
Method getBasicFeed
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getBasicFeed($extra_param)
{
$data = array();
$pattern = '/\[(?P<datetime>.*)\] (?P<logger>\w+).(?P<level>\w+): (?P<message>.*[^ ]+) (?P<context>[^ ]+) (?P<extra>[^ ]+)/';
Method export
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function export()
{
if (!$this->isExportable()) {
show_404();
}
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 resetPasswordByUserId
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resetPasswordByUserId($user_id)
{
// Reading user info
$user = $this->getById($user_id, 'user_email, display_name');
if (!$user) {
Method saveById
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function saveById($id, $data)
{
foreach ($data as $_param_name => $_param_value) {
if (!in_array($_param_name, $this->getAcceptedPostFields())) {
continue;
Method generateHandleFileUpload
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateHandleFileUpload(&$save_array)
{
if (count($this->file_upload_fields) == 0) {
return;
}
Method build
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function build($module_name, $policy_entries)
{
$allowed_entity_accesses = array('NONE', 'READ', 'WRITE', 'FULL_CONTROL');
$doc = new DomDocument('1.0', 'UTF-8');
Method getDistinctAssoc
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDistinctAssoc($column, $table = false, $pairs = false, $where_conditions = false)
{
if (!$table) {
$table = $this->getTable();
}
Method admin_account
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function admin_account()
{
if ($this->get_installation_data('authentification_driver') != 'native') {
redirect(admin_url() . 'installer/features');
}
Method genericupload
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function genericupload($current_path = '', $file_field_name = 'file')
{
$make_filenames_nice = true;
$error = false;
Method display_steps
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function display_steps($steps, $type)
{
$html = '';
$html .= '<nav class="steps ' . $type . '">' . "\n";
$i = 0;
Method register
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function register($display_name, $user_email, $user_login = false, $password = false, $group_ids = array(), $is_root = false, $send_email_notification = true, $data = array(), $account_type = 0)