Showing 4,652 of 306,333 total issues
Method findEmail
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function findEmail(int $record, string $module): string
{
if (!\App\Record::isExists($record)) {
return false;
}
Method getLeadsBySource
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getLeadsBySource($owner, $dateFilter)
{
$query = new \App\Db\Query();
$query->select([
'leadsourceid' => 'vtiger_leadsource.leadsourceid',
Method getAccountFieldsForLeadConvert
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAccountFieldsForLeadConvert()
{
$accountsFields = [];
$moduleName = 'Accounts';
Method getHeaderLinks
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHeaderLinks(): array
{
$links = [];
$detailUrl = $this->recordModel->getFullDetailViewUrl();
$editUrl = $this->recordModel->isEditable() ? $this->recordModel->getEditViewUrl() : '';
Method getHistory
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHistory($pagingModel, $type = false)
{
if (empty($type)) {
$type = 'all';
}
Method getStructure
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStructure(Vtiger_Record_Model $recordModel, App\Request $request): array
{
Vtiger_Field_Model::$tabIndexDefaultSeq = 1000;
$values = [];
$moduleModel = $recordModel->getModule();
Method formatDateDiffInStrings
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function formatDateDiffInStrings($dateTime)
{
// http://www.php.net/manual/en/datetime.diff.php#101029
$seconds = strtotime('now') - strtotime($dateTime);
if (0 === $seconds) {
Method setQtyInStock
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setQtyInStock(string $moduleName, array $data, int $storageId, string $action)
{
$db = App\Db::getInstance();
$qtyInStock = [];
foreach ($data as $product) {
Method readCoordinatesByRecords
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readCoordinatesByRecords(array $records)
{
$moduleModel = $this->get('srcModuleModel');
$groupByField = $this->get('groupBy');
$coordinatesCenter = $this->get('coordinatesCenter');
Function deleteCustomRule
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
deleteCustomRule: function (deleteElement) {
let deleteUrl = deleteElement.data('url');
let currentRow = deleteElement.closest('.js-custom-rule-entries');
app.showConfirmModal({
title: app.vtranslate('LBL_DELETE_CONFIRMATION'),
- 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 showStats
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
showStats: function (data, modules) {
const thisInstance = this;
let container = $('.LangManagement'),
html = '<div class="col-md-12"><div class="panel panel-default"><div class="panel-body col-md-12">',
langStats = 0,
- 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 registerTileClickEvent
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
registerTileClickEvent: function (tileContainer) {
tileContainer.on('click', '.js-card-body', function (e) {
if ($(e.target).hasClass('js-show-image-preview')) return;
if ($(e.target).closest('div').hasClass('actions')) return;
if ($(e.target).is('button') || $(e.target).parent().is('button')) 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 loadData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
loadData: function () {
let orderBy = this.sourceContainer.find('#orderBy').val();
orderBy = orderBy ? JSON.parse(orderBy) : [];
if (orderBy && Object.keys(orderBy).length) {
let baseOrderBy = this.container.find('.js-base-element');
- 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 registerSplit
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
registerSplit: function (container) {
var rightSplitMaxWidth = (400 / this.windowW) * 100;
var splitMinWidth = (25 / this.windowW) * 100;
var splitMaxWidth = 100 - splitMinWidth;
var listPreview = container.find('.js-detail-preview');
- 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 getInstance
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
getInstance: function () {
if (Vtiger_List_Js.listInstance === false) {
let module = app.getModuleName(),
parentModule = app.getParentModuleName(),
moduleClassName,
- 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 setFieldOptions
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
setFieldOptions: function (fieldName, options) {
const fieldElement = this.getForm().find(`[name="${fieldName}"]`),
fieldInfo = fieldElement.data('fieldinfo');
if (fieldElement.is('select') && fieldInfo) {
const val = fieldElement.val() ?? '',
- 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 changeUrl
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
changeUrl(params) {
let fullUrl = '';
if (params.data && typeof params.data.historyUrl !== 'undefined') {
fullUrl = params.data.historyUrl;
}
- 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 arrayDiffAssocRecursive
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function arrayDiffAssocRecursive($array1, $array2)
{
$difference = [];
foreach ($array1 as $key => $value) {
if (\is_array($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 importTables
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function importTables($modulenode)
{
if (empty($modulenode->tables) || empty($modulenode->tables->table)) {
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 setUp
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function setUp(): void
{
if (\file_exists(self::$testDataPath)) {
$this->fileUrl = self::$testDataPath;
} elseif (!empty($_SERVER['YETI_TEST_MODULE_KEY'])) {
- 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"