Showing 486 of 487 total issues
Function getAvailableThemes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getAvailableThemes()
{
$theme_path = $this->config->item('theme_path');
$dir = opendir($theme_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
Function describeSystemControllers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function describeSystemControllers()
{
$controllers = array();
$path = APPPATH . 'controllers/admin/';
- 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 update
has a Cognitive Complexity of 6 (exceeds 5 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);
- 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 setMappedFilterFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function setMappedFilterFields($fields_array)
{
if (!$fields_array || count($fields_array) == 0) {
$this->mapped_filter_fields = array();
return true;
- 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 sessionCounter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
sessionCounter: function (sessionTimeoutUTC, serverOffsetSec) {
var today = new Date();
var todaySecsUTC = Math.floor(today.getTime() / 1000 + (today.getTimezoneOffset() * 60));
- 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 toValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function toValue($obj)
{
if ($obj->is_serialized) {
return json_decode($obj->value);
} elseif ($obj->is_boolean) {
- 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 resetPasswordByUserId
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function resetPasswordByUserId($user_id)
{
// Reading user info
$user = $this->getById($user_id, 'user_email, display_name');
if (!$user) {
- 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 saveById
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function saveById($id, $data)
{
if (!$id) {
if (!isset($data['language_code']) || !$data['language_code']) {
$data['language_code'] = 'en';
- 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 handleForeignKeys
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function handleForeignKeys()
{
foreach ($this->fields as &$field) {
if ($field['foreign_key_table']) {
if ($this->getId()) {
- 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 configure
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function configure()
{
$module = $this->input->getParam('module');
$render_as_module = $this->input->getParam('render_as_module');
- 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 generateForeignKeyManyToManyDoInsert
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function generateForeignKeyManyToManyDoInsert($save_id_values, $field, $where_conditions)
{
foreach ($save_id_values as $right_id) {
// There is no value specified, skip the cycle
if (!$right_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 niceuri
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function niceuri($name)
{
//form_prep
if (strlen($name) == 0) {
return '';
- 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 mergeLanguageTranslationPairs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function mergeLanguageTranslationPairs($translation_file_path, $language_pairs)
{
// Merging existing translations with the new pairs
if (file_exists($translation_file_path)) {
$existing_language_pairs = $this->languagehelper->getLanguageByPath($translation_file_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
Function getCompiledDescription
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getCompiledDescription($content, $line)
{
if (!$this->meta_description_pattern && !$this->meta_description_pattern_callback) {
return '';
}
- 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 moduleLanguage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function moduleLanguage($module_name = false, $langfile = false, $idiom = false)
{
if (!$idiom) {
if (class_exists('Dispatcher') && ($d_lang = Dispatcher::getSiteLanguage())) {
$idiom = $d_lang->ci_language;
- 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 getOrderFieldName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getOrderFieldName($available_field_names, $definition)
{
$possible_order_field_names = array('item_order', 'position', 'pos');
foreach ($possible_order_field_names as $possible_order_field_name) {
- 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 getUpdatedAtFieldName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getUpdatedAtFieldName($available_field_names, $definition)
{
foreach ($available_field_names as $available_field_name) {
if (strpos($available_field_name, 'update') !== false) {
// Input type check
- 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 getImageFieldNameBestMatch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getImageFieldNameBestMatch($available_field_names, $possible_image_field_names)
{
foreach ($available_field_names as $available_field_name) {
foreach ($possible_image_field_names as $possible_image_field_name) {
if (strpos($available_field_name, $possible_image_field_name) !== 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 edit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function edit($display_view = true)
{
$id = $this->input->getParam('id');
if ($id && !$this->isEditable()) {
- 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 display
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function display($view = false, $display_header = true, $display_footer = true, $return = false)
{
$this->benchmark->mark('display_start');
if ($this->already_displayed) {
- 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"