Showing 482 of 487 total issues
Function display_breadcrumb
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function display_breadcrumb($breadcrumb_array, $icon = false)
{
$count = count($breadcrumb_array);
$o = '';
- 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 module_icon_url
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function module_icon_url($module_name = false)
{
$CI = get_instance();
if (!$module_name) {
if (isset($CI->modulerunner)) {
- 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 __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct()
{
// Getting cache path from configuration
$path = $this->config->raw_item('cache_path');
$this->is_enabled = $this->config->raw_item('cache_object_is_enabled');
- 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 deeply nested control flow statements. Open
for ($i = 0; $i < 99; $i++) {
$keys[] = $i;
}
Method addField
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addField($field, $label = false, $type = false, $default_value = false, $rules = false, $values = false)
Function google_maps_locate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function google_maps_locate($address)
{
$url = 'http://maps.google.com/maps/api/geocode/json?address=' . urlencode($address) . '&components=country:PL&sensor=false';
$contents = file_get_contents($url);
if (!$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
Function module_icon_small_url
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function module_icon_small_url($module_name = false)
{
$CI = get_instance();
if (!$module_name) {
if (isset($CI->modulerunner)) {
- 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 readDirectoryContents
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function readDirectoryContents($directory = './')
{
$files = array();
$dir = opendir($directory);
- 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 deeply nested control flow statements. Open
if ($normalize_keys) {
foreach ($keys as &$key) {
$key = $this->normalizeKey($key);
}
}
Function transformDataFeed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function transformDataFeed($data_feed)
{
$final_data_feed = array();
if (isset($data_feed[0]) && is_array($data_feed[0])) {
foreach ($data_feed[0] as $key => $value) {
- 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 getTranslatedValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getTranslatedValue(array $definition, $fieldKey, $suffix = '')
{
$translatedValue = false;
if ($this->lang !== null) {
- 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 moduleLibrary
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function moduleLibrary($module_name, $library, $params = null)
{
if ($library == '') {
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 getModuleTranslationKeys
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getModuleTranslationKeys($module, $languages = false, $language_file = false)
{
$language_file = $this->ensureLanguageFileIsSet($module, $language_file);
if (!$languages) {
- 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 delete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function delete()
{
$id = $this->input->getParam('id');
if (!$id || !$this->is_deletable) {
- 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 line
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function line($line = '', $default_value = null)
{
// Changed parameter order - might be problematic
if ($line == '' || !isset($this->language[$line])) {
- 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 getCurrentLanguage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getCurrentLanguage()
{
$CI = &get_instance();
$idiom = 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
Method buildTranslations
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function buildTranslations($module_name, $translations, $module_label, $language_pairs, $directory, $module_name_lower_case)
Function _datagrid_format_item_order_column
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _datagrid_format_item_order_column($content, &$line)
{
$id_field_name = &$this->id_field_name;
$o = $this->datagrid->getOrder();
- 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 formatCells
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function formatCells($menu, $level, &$lang, &$url_suffix, $site_language, $view)
Consider simplifying this complex logical expression. Open
<?php if ((SecurityManager::hasAccess('utilities', 'flush_html_cache') || SecurityManager::hasAccess('utilities', 'flush_security_policy_cache') || SecurityManager::hasAccess('utilities', 'flush_system_cache') || SecurityManager::hasAccess('acl') || SecurityManager::hasAccess('logs') || SecurityManager::hasAccess('utilities', 'systeminfo'))): ?>
<h1 class="contrasted"><?= $lang->line('utilities_label_cache') ?></h1>
<ul class="dashboard_actions clear">