Showing 4,652 of 306,333 total issues
Function getStatistics
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getStatistics(App\Request $request)
{
$dataReader = $this->getQuery($request)->createCommand()->query();
$records = $duplicates = 0;
$emails = $emailsByField = [];
- 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 row
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function row(App\Request $request): void
{
$relatedModuleSkip = $request->getBoolean('relatedModuleSkip', false);
$sourceModuleName = $request->getByType('sourceModuleName', \App\Purifier::ALNUM);
$sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModuleName);
- 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 saveRecord
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function saveRecord(App\Request $request)
{
$this->getRecordModelFromRequest($request);
$eventHandler = $this->record->getEventHandler();
$skipHandlers = $request->getArray('skipHandlers', \App\Purifier::ALNUM, [], \App\Purifier::INTEGER);
- 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 13 (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 getQueryByModuleField
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getQueryByModuleField($sourceModule, $field, $record, App\QueryGenerator $queryGenerator)
{
if ('SRecurringOrders' === $sourceModule && $record) {
$queryGenerator->addJoin(['INNER JOIN', 'u_#__srecurringorders', 'u_#__srecurringorders.accountid = vtiger_contactdetails.parentid AND u_#__srecurringorders.srecurringordersid = :records', [':records' => $record]]);
}
- 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 saveMap
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function saveMap()
{
$saveMap = $this->request->get('save_map');
$mapName = $this->request->get('save_map_as');
if ($saveMap && !empty($mapName)) {
- 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 13 (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 process
has a Cognitive Complexity of 13 (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 getWidgetData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getWidgetData($moduleName, $owner)
{
$rawData = $data = $years = [];
$dateStart = ((int) date('Y') - 2) . '-01-01';
$dateEnd = date('Y-m-d', strtotime('last day of december'));
- 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 readAllCoordinatesFromCustomeView
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function readAllCoordinatesFromCustomeView()
{
$moduleModel = $this->get('srcModuleModel');
$moduleName = $moduleModel->getName();
$excludedIds = $this->get('excluded_ids');
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function get()
{
$rawData = $records = [];
$showRaw = $this->isRawData();
$queryGenerator = $this->getQuery();
- 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 post
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function post()
{
$relatedModule = 'Approvals';
$referenceFieldModel = null;
$queryGenerator = (new \App\QueryGenerator($this->controller->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 registerChangeEventForCurrencySeparator
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerChangeEventForCurrencySeparator: function () {
let form = jQuery('form');
jQuery('[name="currency_decimal_separator"]', form).on('change', function (e) {
let element = jQuery(e.currentTarget);
let selectedValue = element.val();
Function registerDeleteInventoryField
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerDeleteInventoryField: function () {
let thisInstance = this;
let container = thisInstance.getInventoryViewLayout();
let selectedModule = this.container.find('[name="layoutEditorModules"]').val();
container.find('.deleteInventoryField').on('click', function (e) {
Function registerShowSortActionsModal
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerShowSortActionsModal: function () {
$('.js-workflow-sort-button').on('click', () => {
let sourceModule = this.topMenuContainer.find('.js-workflow-module-filter option:selected').val();
let url = 'index.php?module=Workflows&parent=Settings&view=SortActionsModal&sourceModule=' + sourceModule;
app.showModalWindow(null, url, (modalContainer) => {
Function cb
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
cb: function (container) {
container.find('.removeChannel').on('click', function (e) {
var currentTarget = $(e.currentTarget);
var row = currentTarget.closest('.form-group');
row.remove();
Function loadRelatedList
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadRelatedList: function (params) {
let aDeferred = jQuery.Deferred();
let thisInstance = this;
if (typeof thisInstance.moduleName === 'undefined' || thisInstance.moduleName.length <= 0) {
let currentInstance = Vtiger_Detail_Js.getInstance();
Function parseConditions
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseConditions: function (params) {
let listViewContainer = this.getContainer();
let lockedEmptyFields = [];
let lockedInput = listViewContainer.find('.js-empty-fields').val();
if (!!lockedInput) {
Function registerAppendCustomLabels
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerAppendCustomLabels() {
let shorterNamesContainer = this.container.find('.js-custom-name-fields');
let selectedColumns = this.container
.find('.js-view-columns-select option:selected')
.toArray()
Function registerEvents
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerEvents(container) {
const form = container.find('form');
form.validationEngine(app.validationEngineOptions);
container.find('.js-modal__save').on('click', (_e) => {
if (form.validationEngine('validate')) {