Showing 4,652 of 306,333 total issues
Function doTask
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function doTask($recordModel)
{
if (empty($this->recordCollector)) {
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 process
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$page = $request->getInteger('page');
- 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 initInventoryData
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function initInventoryData(array $items, bool $userFormat = true)
{
\App\Log::trace('Entering ' . __METHOD__);
$inventoryModel = Vtiger_Inventory_Model::getInstance($this->getModuleName());
$fields = $inventoryModel->getFields();
- 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 sanitizeInventoryValue
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function sanitizeInventoryValue($value, $columnName): string
{
if ($field = $this->inventoryFields[$columnName] ?? false) {
if (\in_array($field->getType(), ['Name', 'Reference'])) {
$value = trim($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 process
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function process()
{
$html = '';
$relationModuleName = 'Products';
$relationListView = \Vtiger_RelationListView_Model::getInstance($this->textParser->recordModel, $relationModuleName);
- 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 getDefaultFieldValues
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function getDefaultFieldValues()
{
$key = $this->module . '_' . $this->user->getId();
if (\App\Cache::staticHas('DefaultFieldValues', $key)) {
return \App\Cache::staticGet('DefaultFieldValues', $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"
Further reading
File Record.php
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/* +***********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
Function loadMenuTree
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadMenuTree: function () {
var thisInstance = this;
if (thisInstance.treeInstance == false) {
var data = JSON.parse($('#treeValues').val());
if (data.length == 0) {
File ChartFilter.js
has 280 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';
$.Class(
'Base_ChartFilter_JS',
Function constructor
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(element) {
const thisInstance = this;
this.elements = {};
this.options = {
showCarousel: true
Function init
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
init() {
const field = this.getField();
$('.js-pwd-auto-generate', this.container)
.off('click')
.on('click', (e) => {
Function showModalWindow
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
showModalWindow: function (data, url, cb, paramsObject = {}) {
if (!app.isCurrentWindowTarget('app.showModalWindow', arguments)) {
return false;
}
const thisInstance = this;
Method getUserQuickMenuLinks
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getUserQuickMenuLinks(\App\Request $request): array
{
$userModel = \Users_Record_Model::getCurrentUserModel();
$headerLinks[] = [
'linktype' => 'GROUPNAME',
Method computeLabels
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function computeLabels($moduleName, $ids, $search = false): ?array
{
if (empty($moduleName) || empty($ids)) {
return [];
}
Method getFieldValue
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFieldValue(string $magentoFieldName, ?string $crmFieldName = null)
{
$parsedFieldName = $crmFieldName ?? $this->getFieldNameCrm($magentoFieldName);
$methodName = 'getCrm' . \ucfirst($parsedFieldName);
$fieldLevels = explode('|', $magentoFieldName);
Method createModule
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createModule(array $moduleInformation)
{
$moduleInformation['entityfieldname'] = strtolower(self::toAlphaNumeric($moduleInformation['entityfieldname']));
$module = new vtlib\Module();
Method getQuery
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getQuery()
{
$queryGenerator = new App\QueryGenerator($this->getModuleName());
if ($this->has('customFilter')) {
$queryGenerator->initForCustomViewById($this->get('customFilter'));
Method convertToNativeLink
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function convertToNativeLink()
{
$url = $this->get('linkurl');
if (empty($url)) {
return $url;
File RecordsList.php
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Records list view class.
*
Method readAllCoordinatesFromCustomeView
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readAllCoordinatesFromCustomeView()
{
$moduleModel = $this->get('srcModuleModel');
$moduleName = $moduleModel->getName();
$excludedIds = $this->get('excluded_ids');