Showing 1,388 of 1,858 total issues
Function install
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function install() {
foreach ($this->demodata->children() as $demodataName => $node) {
$handlerClass = 'Demodata' . ucfirst($demodataName);
include_once __DIR__ . DIRECTORY_SEPARATOR . $handlerClass . EXT;
- Read upRead up
- Create a ticketCreate a ticket
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 getRemoteTemplate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getRemoteTemplate($templateId = NULL) {
if ($templateId) {
$template_content = file_get_contents(self::REMOTE_TEMPLATES_REPOSITORY . $templateId);
if ($template_content) {
- Read upRead up
- Create a ticketCreate a ticket
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 ($lang) {
$lang = mb_ereg_search_getregs(); //get first result
do {
$origin = mb_ereg_replace('!\s+!', ' ', $lang[1]);
- Create a ticketCreate a ticket
Function prepareData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function prepareData(\SimpleXMLElement $field) {
$attributes = $field->attributes();
$fieldTypeId = $this->fieldTypes[(string) $attributes->type];
$this->fieldData = [
- Read upRead up
- Create a ticketCreate a ticket
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 searchLang
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function searchLang($origin, $data, $entity_type, $entity_name, $language) {
switch ($this->searchType) {
case 'all':
if ($this->searchString($origin) || $this->searchString($data['translation'])) {
$data['origin'] = $origin;
- Read upRead up
- Create a ticketCreate a ticket
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 loadDefaultComponents
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function loadDefaultComponents(array $except = []) {
if (count($this->defaultComponents) > 0) {
return;
}
$componentsPath = __DIR__ . '/../components/';
- Read upRead up
- Create a ticketCreate a ticket
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 getComponents
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getComponents($type = self::COMPONENTS_ALL) {
$tm = TemplateManager::getInstance();
$this->loadDataFromXml();
foreach ($this->xmlData['components'] as $componentName) {
- Read upRead up
- Create a ticketCreate a ticket
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 makePoFileSettings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function makePoFileSettings($data = []) {
if (!empty($data)) {
$data = $this->prepareSettingsArray($data);
$settings = [
'msgid ""',
- Read upRead up
- Create a ticketCreate a ticket
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 changefreq
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function changefreq() {
if ($this->input->post()) {
/**
* Prepare data to update changefreq
*/
- Read upRead up
- Create a ticketCreate a ticket
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 updateParams
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function updateParams($params = []) {
if (count($params) > 0) {
foreach ($params as $key => $data) {
$component = \CI::$APP->db->where('component', $this->name)->where('key', $key)->get('template_settings');
- Read upRead up
- Create a ticketCreate a ticket
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 findCyrillicKeys
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function findCyrillicKeys($module) {
if ($module == 'main') {
$langStrings = self::parseMain();
} else {
$langStrings = self::parseModule($module);
- Read upRead up
- Create a ticketCreate a ticket
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 autosearch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function autosearch() {
switch ($this->input->post('queryString')) {
case 'product':
$entity = SProductsQuery::create()->setComment(__METHOD__)->joinWithI18n($this->def_locale)->filterByActive(true)->withColumn('SProductsI18n.Name', 'Name')->select(['Id', 'Name'])->find()->toArray();
break;
- Read upRead up
- Create a ticketCreate a ticket
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 uploadByUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function uploadByUrl($url, $content = '') {
if (!$content) {
$ext = pathinfo($url, PATHINFO_EXTENSION);
if ($ext != 'zip') {
throw new Exception(lang('Wrong file type', 'template_manager'));
- Read upRead up
- Create a ticketCreate a ticket
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 settings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function settings() {
if ($this->input->post()) {
/** Data to update */
$data = $this->input->post('settings');
- Read upRead up
- Create a ticketCreate a ticket
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 _get_sub_menus
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _get_sub_menus($id) {
$sub_menus = [];
foreach ($this->sub_menu_array as $sub_menu) {
if ($sub_menu['parent_id'] == $id) {
- Read upRead up
- Create a ticketCreate a ticket
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 validateData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function validateData($data, $signatureKey) {
$fields = [];
foreach ($data as $name => $value) {
if ($name !== 'WMI_SIGNATURE') { $fields[$name] = $value;
- Read upRead up
- Create a ticketCreate a ticket
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() {
parent::__construct();
$this->time = time();
- Read upRead up
- Create a ticketCreate a ticket
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 ($n_title['title']) {
$menus[$i]['title'] = $n_title['title'];
}
- Create a ticketCreate a ticket
Function display
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function display($url) {
$route = $this->router->findRoute($url);
if (!$route) {
- Read upRead up
- Create a ticketCreate a ticket
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 set_meta_tags
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function set_meta_tags($title = '', $keywords = '', $description = '', $page_number = '', $showsitename = 0, $category = '') {
- Create a ticketCreate a ticket