Showing 486 of 487 total issues
Function navFilesTree
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
navFilesTree: function (el, trigger) {
/* if item has .active, leave it open */
$('li', el).each(function () {
if ($('ul a', this).hasClass('active')) {
- 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 index
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function index()
{
$enable_frontend = $this->config->item('cms_enable_frontend');
$intranet = $this->config->item('cms_intranet');
- 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 drawSimpleLineChart
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function drawSimpleLineChart($data_feed, $collumn1_desc = '', $collumn2_desc = '', $width = 1200, $height = 200, $max_value = 10, $column1_data_type = "string", $column2_datatype = "number", $colors = array(), $type = 'number')
{
$id = $this->generateId('line_chart');
$out = $this->includeJavaScripts();
- 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 storeObject
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function storeObject($name, $object_to_write, $collection = '')
{
$hash = $this->computeHash($name);
$file_path = $this->computePath($collection, $hash);
- 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 cleanup
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function cleanup($collection = '')
{
if ($this->is_enabled !== true) {
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 generateFilePreview
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function generateFilePreview($field, $valueEscaped, $display_delete_file_link)
{
\CI_Controller::get_instance()->load->helper('number');
$output_element = '';
if ($valueEscaped) {
- 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 revisionrestorefield
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function revisionrestorefield()
{
$id = $this->input->getParam('id');
$revision_id = $this->input->getParam('revision_id');
$field = $this->input->getParam('field');
- 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 export
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function export()
{
if (!$this->isExportable()) {
show_404();
}
- 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 resolveModuleDirectory
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function resolveModuleDirectory($module_name, $web_path = false)
{
if (isset($this->module_directory_cache[$module_name][$web_path])) {
// Some kind of runtime cache
return $this->module_directory_cache[$module_name][$web_path];
- 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 validateByEmail
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validateByEmail($user_email, $password)
{
// Attempt to select user password metadata
$row = $this->db->select('user_id, hashing_salt, hashing_algorithm, hashing_iterations')
->from($this->getTable())
Method validateByLogin
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validateByLogin($user_login, $password)
{
$row = $this->db->select('user_id, hashing_salt, hashing_algorithm, hashing_iterations')
->from($this->getTable())
->where('user_login', $user_login)
Method writeDatabase
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function writeDatabase($data)
{
$db = $this->load->database($this->getDefaultDatabaseConfig($data), true);
$error = false;
Method storeObject
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function storeObject($name, $object_to_write, $collection = '')
{
$hash = $this->computeHash($name);
$file_path = $this->computePath($collection, $hash);
Method __construct
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
parent::__construct(false);
$this->benchmark->mark('module_admin_controller_start');
Method show
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show()
{
$module = $this->input->getParam('module');
$file_name = $this->input->getParam('file_name');
$is_system = $module == 'system';
Method generateSecurityPolicy
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateSecurityPolicy($module_name, $module_name_singular, $policy_save_path)
{
$method_default_access = array(
'index' => 'READ',
'edit' => 'WRITE',
Method cleanPagesCache
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cleanPagesCache()
{
$return = array('size' => 0, 'count' => 0);
$cache_path = $this->config->item('cache_path');
Method saveAllConfigurationVariables
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function saveAllConfigurationVariables($data)
{
$known_config_data = (array)$this->getAllConfigurationVariables();
$data = array_merge($known_config_data, $data);
Method setupDefaultConfig
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setupDefaultConfig()
{
$this->load->config('editor');
$descriptor['editor_css_file'] = $this->config->item('editor_css_file');
$descriptor['editor_css_body_id'] = $this->config->item('editor_css_body_id');
Method update
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update($module_name, $is_displayed_in_menu = false, $is_displayed_in_utilities = true, $parent_module_id = false)
{
// Reading module info
$module_info = $this->getInfoByName($module_name);