Showing 4,652 of 306,333 total issues
Function process
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public function process()
{
\App\Log::trace('Start create AddressBook');
$limit = App\Config::performance('CRON_MAX_NUMBERS_RECORD_ADDRESS_BOOK_UPDATER');
- 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
File ListSearch.js
has 432 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */
'use strict';
jQuery.Class(
'YetiForce_ListSearch_Js',
Function initInventoryValuesAuto
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
private function initInventoryValuesAuto()
{
$invData = [];
$counter = 1;
foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
- 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 getPrivilegeQuery
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
public static function getPrivilegeQuery(Db\Query $query, $moduleName, $user = false, $relatedRecord = null)
{
if ($user && $user instanceof User) {
$userId = $user->getId();
} elseif (!$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 getTypeDetailsForAddField
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
public function getTypeDetailsForAddField($fieldType, $params)
{
$displayType = 1;
$importerType = new \App\Db\Importers\Base();
switch ($fieldType) {
- 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 getStructure
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
public function getStructure()
{
if (!empty($this->structuredValues)) {
return $this->structuredValues;
}
- 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
File Purifier.php
has 426 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Purifier file.
*
* @package App
Method process
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process()
{
$html = '';
$inventoryRows = [];
if (!$this->textParser->recordModel->getModule()->isInventory()) {
Method updateTables
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateTables(Base $importer)
{
$this->logs .= "> start update tables ({$importer->dbType})\n";
$startMain = microtime(true);
$schema = $importer->db->getSchema();
File MultiImage.php
has 421 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* UIType MultiImage Field Class.
*
* @package UIType
Function hideHorizontalBarDatalabelsIfNeeded
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
hideHorizontalBarDatalabelsIfNeeded: function hideHorizontalBarDatalabelsIfNeeded(chart) {
let getDatasetsMeta = function (chart) {
const datasets = [];
const data = chart.data;
if (typeof data !== 'undefined' && typeof data.datasets !== 'undefined' && Array.isArray(data.datasets)) {
- 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 hideVerticalBarDatalabelsIfNeeded
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
hideVerticalBarDatalabelsIfNeeded: function (chart) {
let getDatasetsMeta = function (chart) {
const datasets = [];
const data = chart.data;
if (typeof data !== 'undefined' && typeof data.datasets !== 'undefined' && Array.isArray(data.datasets)) {
- 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 vtwsConvertlead
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
public static function vtwsConvertlead($entityvalues, Users_Record_Model $user)
{
\App\Log::trace('Start ' . __METHOD__);
if (empty($entityvalues['assignedTo'])) {
$entityvalues['assignedTo'] = $user->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 getBacktrace
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
public static function getBacktrace($minLevel = 1, $maxLevel = 0, $sep = '#')
{
$trace = '';
foreach (debug_backtrace() as $k => $v) {
if ($k < $minLevel) {
- 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 loadData
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
public function loadData(): void
{
if (empty($this->data)) {
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 getWidgetTimeControl
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
public function getWidgetTimeControl($user, $time)
{
if (!$time) {
return ['show_chart' => 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 doTask
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doTask($recordModel)
{
if (!\App\Module::isModuleActive('Calendar')) {
return;
}
Method importRecords
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function importRecords()
{
$moduleName = $this->module;
$tableName = Import_Module_Model::getDbTableName($this->user);
File Record.php
has 417 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Settings TreesManager record model class.
*
Cron
has 44 functions (exceeds 20 allowed). Consider refactoring. Open
class Cron
{
protected static $cronAction = false;
protected static $baseTable = 'vtiger_cron_task';
protected static $schemaInitialized = false;