Showing 4,652 of 306,333 total issues
Function process
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$moduleName = $request->getModule();
$record = $request->getInteger('record');
$recordModel = Vtiger_Record_Model::getInstanceById($record, $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
Function getPagination
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getPagination(App\Request $request)
{
$viewer = $this->getViewer($request);
$cvId = $request->getByType('viewname', 2);
$pageNumber = $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 getHistory
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function getHistory()
{
$results = (new \App\Db\Query())->from('u_#__browsinghistory')
->where(['userid' => App\User::getCurrentUserId()])
->orderBy(['id' => SORT_DESC])
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request, $widget = null)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$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 validate
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function validate($value, string $columnName, bool $isUserFormat, $originalValue = null)
{
if ($columnName === $this->getColumnName()) {
if ($isUserFormat) {
$value = $this->getDBValue($value, $columnName);
- 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 getQuery
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getQuery()
{
$queryGenerator = new App\QueryGenerator($this->getModuleName());
if ($this->has('customFilter')) {
$queryGenerator->initForCustomViewById($this->get('customFilter'));
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request, $widget = null)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$data = $request->getAll();
- 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 getChild
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getChild(int $id, array &$childRow, int $depthBase): array
{
\App\Log::trace('Entering getChild(' . $id . ',' . $depthBase . ') method ...');
if (empty($id) || $depthBase === \App\Config::module('HelpDesk', 'MAX_HIERARCHY_DEPTH')) {
\App\Log::error('Exiting getChild method ... - exceeded maximum depth of hierarchy');
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request, $widget = null)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
if ($widget && !$request->has('widgetid')) {
- 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 getRecords
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getRecords(\App\QueryGenerator $mainQueryGenerator, int $parentId, string $type = 'child'): void
{
if (0 === $this->limit || isset($this->recursion[$parentId][$type])) {
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 get
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function get(): array
{
$return = parent::get();
if ($this->controller->headers['x-header-fields'] ?? 0) {
$fieldsHeader = [];
- 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 getProject
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function getProject($id, $viewName = null)
{
if (!\is_array($id) && isset($this->tasksById[$id])) {
return [$this->tasksById[$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 registerContextHelp
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerContextHelp: function () {
$(document).on('click', '.js-context-help', function (e) {
const customConfig = {
toolbar: 'Min'
};
File LeadMapping.js
has 260 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.
Function registerRowsEvent
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerRowsEvent: function () {
const self = this;
if (this.relatedView === 'List' || this.relatedView === 'Detail') {
this.content.find('.listViewEntries').on('click', function (e) {
if ($(e.target).hasClass('js-no-link')) return;
Function loadChart
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadChart: function () {
var data = $('.sumaryRelatedTimeControl .widgetData').val();
if (data == undefined || data == '') {
return false;
}
Function registerMobileEvents
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerMobileEvents: function () {
const self = this,
container = this.getContentsContainer();
$('.rightHeaderBtnMenu').on('click', function () {
self.hideActionMenu();
Function registerSubmitForm
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerSubmitForm: function () {
let self = this;
self.container.on('click', "[name='saveButton']", (e) => {
let formMapping = self.container.find('form.js-form-converter');
if (formMapping.validationEngine('validate')) {
Function updateActivityState
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateActivityState: function (currentTarget) {
let params = {
module: 'Calendar',
action: 'ActivityStateAjax',
record: currentTarget.data('id'),
Function registerAutoCompleteFields
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerAutoCompleteFields: function (container) {
let thisInstance = this;
let formElement = container.closest('form');
container.find('input.autoComplete').autocomplete({
delay: '600',