Showing 4,652 of 306,333 total issues
Function doTask
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function doTask($rawRecordModel)
{
$recordModel = \Vtiger_Record_Model::getCleanInstance($rawRecordModel->getModuleName());
$recordModel->setData($rawRecordModel->getData());
$recordModel->ext = $rawRecordModel->ext;
- 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 getAccountFieldsForLeadConvert
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function getAccountFieldsForLeadConvert()
{
$accountsFields = [];
$moduleName = 'Accounts';
- 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 getInventoryChanges
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function getInventoryChanges()
{
if (!isset($this->inventoryChanges)) {
$changes = [];
if ($this->isCreate() || $this->isUpdate() || $this->isTransferEdit()) {
- 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 getRecordListViewLinksLeftSide
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function getRecordListViewLinksLeftSide()
{
if (!$this->isViewable()) {
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 preProcess
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function preProcess(App\Request $request, $display = true)
{
parent::preProcess($request, false);
$moduleName = $request->getModule();
- 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 getHierarchyData
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function getHierarchyData($id, $baseInfo, $recordId, &$listviewEntries, $getRawData = false, $getLinks = true)
{
\App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
$currentUser = Users_Privileges_Model::getCurrentUserModel();
$hasRecordViewAccess = $currentUser->isAdminUser() || \App\Privilege::isPermitted('Contacts', 'DetailView', $recordId);
- 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 get
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function get(): array
{
$this->loadResponseParams();
$moduleName = $this->controller->request->get('module');
$module = \Vtiger_Module_Model::getInstance($moduleName);
- 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 formatCurrencyValue
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function formatCurrencyValue($value)
{
$currencyPattern = $this->currencyFormat;
$curSeparator = $this->currencySeparator;
$decSeparator = $this->decimalSeparator;
Function registerRelatedListEvents
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerRelatedListEvents: function () {
const thisInstance = this,
relatedList = $('#relatedTabOrder');
App.Fields.Picklist.showSelect2ElementView(
relatedList.find('.relatedTabModulesList .js-related-column-list-container .select2_container'),
Function render
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
this.bindAttr('data', function (data) {
// ported from php DataFormatter
var formatDuration = function (seconds) {
if (seconds < 0.001) return (seconds * 1000000).toFixed() + 'μs';
Method getInventoryTable
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getInventoryTable(array $config): string
{
$rawText = empty($config['href']) || 'yes' !== $config['href'];
$inventory = \Vtiger_Inventory_Model::getInstance($this->moduleName);
$fields = $inventory->getFieldsByBlocks();
Method getBreadcrumbs
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getBreadcrumbs($pageTitle = false)
{
$breadcrumbs = [];
$request = App\Request::init();
$userPrivModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
`` has 34 functions (exceeds 20 allowed). Consider refactoring. Open
export default {
maximize({ commit }, isMini) {
commit('miniMode', isMini)
},
toggleLeftPanel({ commit, getters }, newValue) {
WebservicePremiumTest
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
final class WebservicePremiumTest extends \Tests\Base
{
use AssertsTrait;
/** @var int Api server id. */
Consider simplifying this complex logical expression. Open
if (empty(self::$browserCache)) {
$browserAgent = strtolower(\App\Request::_getServer('HTTP_USER_AGENT', ''));
$browser = new \stdClass();
$browser->ver = 0;
File Record.php
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Settings menu record model class.
*
Function setMarkers
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
setMarkers: function (data) {
var thisInstance = this;
var markerArray = [];
var container = this.container;
var map = this.mapInstance;
File Index.js
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*+***********************************************************************************
* 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
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
Method getComposeParam
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getComposeParam(App\Request $request)
{
$moduleName = $request->getByType('crmModule');
$record = $request->getInteger('crmRecord');
$type = $request->getByType('type');
File Base.php
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Abstract base view controller file.
*
* @package Controller