Showing 4,652 of 306,333 total issues
Function getUi
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getUi: function () {
let comparatorSelectedOptionVal = this.get('comparatorElementVal'),
dateSpecificConditions = this.get('dateSpecificConditions'),
html,
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 inactiveFieldsValidation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
inactiveFieldsValidation: function () {
let editFieldList = this.container.find('.js-edit-field-list').data('value');
let form = this.container.find('form');
for (let fieldName in editFieldList) {
let fieldInfo = editFieldList[fieldName];
- 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 registerPopUpSaveEvent
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
registerPopUpSaveEvent: function (data, fieldUiHolder) {
jQuery('[name="saveButton"]', data).on('click', function (e) {
var valueType = jQuery('.textType', data).val();
fieldUiHolder.find('[name="valuetype"]').val(valueType);
- 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 getInstanceByModuleName
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getInstanceByModuleName: function (moduleName) {
if (typeof moduleName === 'undefined') {
moduleName = app.getModuleName();
}
let parentModule = app.getParentModuleName(),
- 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 massUpdatePagination
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
massUpdatePagination(urlParams = []) {
const self = this,
listViewPageDiv = this.getListViewContainer();
let paginationObject = listViewPageDiv.find('.js-pagination-list'),
totalCount = paginationObject.data('totalCount'),
- 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 refreshWidget
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
refreshWidget: function refreshWidget() {
let thisInstance = this;
let parent = this.getContainer();
let element = parent.find('.js-widget-refresh');
let url = element.data('url');
- 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 setBrowserHistoryOptions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
setBrowserHistoryOptions() {
const historyParams = app.getMainParams('historyParams', true);
let options = {};
if (historyParams && (historyParams.length || Object.keys(historyParams).length)) {
let s = App.Fields.Date.getDateInstance(historyParams.start);
- 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 register
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
register(parentElement, registerForAddon, customParams, className = 'dateField') {
if (typeof parentElement === 'undefined') {
parentElement = $('body');
} else {
parentElement = $(parentElement);
- 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 registerDetailView
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
registerDetailView: function (container) {
this.container = container;
var coordinates = container.find('#coordinates').val();
coordinates = JSON.parse(coordinates);
var startCoordinate = [0, 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 validate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
validate: function () {
let response = this._super();
if (response === true) {
let fieldValue = this.getFieldValue();
let doubleRegex = /(^[-+]?\d+)(\.\d+)?$/;
- 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 exportCustomViews
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function exportCustomViews(ModuleBasic $moduleInstance)
{
$customViewDataReader = (new \App\Db\Query())->from('vtiger_customview')->where(['entitytype' => $moduleInstance->name])
->createCommand()->query();
if (!$customViewDataReader->count()) {
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
validate: function () {
let fieldValue = this.getFieldValue(),
groupSeperator = CONFIG.currencyGroupingSeparator,
integerRegex = new RegExp('(^[-+]?[\\d\\' + groupSeperator + ']+)$', 'g');
if (!fieldValue.match(integerRegex)) {
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
validate() {
let fieldValue = this.getFieldValue();
if (fieldValue === '') {
return true;
}
- 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 invokeValidation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
invokeValidation: function (field, rules, k, options) {
//If validation engine already maked the field as error
// we dont want to proceed
if (typeof options !== 'undefined') {
if (options.isError === true) {
- 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 parseMigration
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function parseMigration($modulenode)
{
if (empty($this->_migrations)) {
$this->_migrations = [];
if (!empty($modulenode->migrations)
- 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 autoLoad
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function autoLoad($className)
{
$parts = explode('_', $className);
$noOfParts = \count($parts);
if ($noOfParts > 2) {
- 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 check
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function check(array $items, array $params): bool
{
$condition = $params['condition'] ?? '';
$b = false;
foreach ($params['rules'] as $rule) {
- 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 check
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function check(array $items, array $params): bool
{
$condition = $params['condition'] ?? '';
$returnVal = false;
foreach ($params['rules'] as $rule) {
- 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 purifyHtml
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function purifyHtml(string $input, $loop = true): string
{
if (empty($input)) {
return $input;
}
- 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 deactivate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function deactivate(string $moduleName, string $fieldName): bool
{
$moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
if (!($fieldModel = $moduleModel->getFieldByName($fieldName))) {
return false;
- 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"