Showing 4,652 of 306,333 total issues
Function validateFilePath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
validateFilePath: function () {
var importFile = jQuery('#import_file');
var filePath = importFile.val();
if (jQuery.trim(filePath) == '') {
var errorMessage = app.vtranslate('JS_IMPORT_FILE_CAN_NOT_BE_EMPTY');
- 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 loadSavedMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
loadSavedMap: function () {
var selectedMapElement = jQuery('#saved_maps option:selected');
var mapId = selectedMapElement.attr('id');
var fieldsList = jQuery('.fieldIdentifier');
var deleteMapContainer = jQuery('#delete_map_container');
- 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 loadScrollbar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
loadScrollbar: function loadScrollbar() {
let container = $(this.getChartContainer(false));
if (!container.length) {
container = this.getContainerContent();
}
- 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 validateToClose
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
validateToClose: function (form) {
const aDeferred = $.Deferred();
let closedStatus = app.getMainParams('closeTicketForStatus', true);
let status = form.find('[name="ticketstatus"] :selected').val();
let progress = $.progressIndicator({ position: 'html', blockInfo: { enabled: 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 getUi
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getUi: function () {
var html = '<select class="select2 form-control" name="' + this.getName() + '">';
var pickListValues = this.getPickListValues();
var selectedOption = this.getValue();
for (var optGroup in pickListValues) {
- 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 strengthMeter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
strengthMeter(pwd) {
let score = 0;
if (pwd.length > 6) score++;
if (pwd.match(/[a-z]/) && pwd.match(/[A-Z]/)) score++;
if (pwd.match(/\d+/)) score++;
- 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 showSelect2ElementView
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
showSelect2ElementView(selectElement, params) {
let self = this;
selectElement = $(selectElement);
if (typeof params === 'undefined') {
params = {};
- 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 registerSearchAddress
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
registerSearchAddress: function () {
const searchValue = this.container.find('.js-search-address'),
searchBtn = this.container.find('.js-search-btn'),
operator = this.container.find('.js-select-operator');
if (operator.length && operator.val()) {
- 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 readAndValidate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
readAndValidate: function (file, editor) {
const aDeferred = jQuery.Deferred(),
fieldInfo = $(editor.element.$).data('fieldinfo');
let length = editor.getData().length,
selectedImg = editor.getSelection();
- 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 registerRange
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
registerRange(parentElement, customParams = {}) {
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 formatToDisplay
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
formatToDisplay(value) {
if (!value) {
value = 0;
}
let groupSeparator = CONFIG.currencyGroupingSeparator;
- 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 showFiltersModal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
showFiltersModal() {
const self = this;
app.showModalHtml({
headerIcon: 'fas fa-filter',
header: app.vtranslate('JS_FILTER_BY_STATUSES'),
- 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 removeEmptyFilesInput
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
removeEmptyFilesInput(form) {
for (let i = 0; i < form.elements.length; i++) {
if (form.elements[i].type === 'file') {
if (form.elements[i].value === '') {
form.elements[i].parentNode.removeChild(form.elements[i]);
- 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 exportDependencies
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function exportDependencies(ModuleBasic $moduleInstance)
{
$moduleId = $moduleInstance->id;
$minVersion = \App\Version::get();
$maxVersion = 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"
Further reading
Function createRecord
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
createRecord(moduleName, params = {}) {
if ('parentIframe' === CONFIG.modalTarget) {
window.parent.App.Components.QuickCreate.createRecord(moduleName, params);
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 showModalData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
showModalData(data, container, paramsObject, cb, url, sendByAjaxCb) {
const thisInstance = this;
let params = {
show: 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 errorLog
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
errorLog: function (error, err, errorThrown) {
if (!CONFIG.debug) {
return;
}
console.warn(
- 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 deletePickLists
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function deletePickLists($moduleInstance)
{
\App\Log::trace('Start', __METHOD__);
$db = \App\Db::getInstance();
$query = (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => $moduleInstance->getId(), 'uitype' => [15, 16, 33]]);
- 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 toggleLeftPanel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
toggleLeftPanel({ commit, getters }, newValue) {
if (getters.mobileMode) {
commit('setLeftPanelMobile', newValue !== undefined ? newValue : !getters['leftPanelMobile'])
} else {
commit('setLeftPanel', newValue !== undefined ? newValue : !getters['leftPanel'])
- 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 registerBlockToggle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
registerBlockToggle(container) {
container.on('click', '.js-toggle-block', function (e) {
const target = $(e.target);
if (
target.is('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"