Showing 4,652 of 306,333 total issues
Function timeCounter
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
timeCounter: function () {
if (this.counter === false) {
this.sec = parseInt(this.sec);
this.min = parseInt(this.min);
this.hr = parseInt(this.hr);
- 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 autoCompleteEvent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
autoCompleteEvent() {
let autoCompleteElement = $('input.treeAutoComplete', this.container);
if (autoCompleteElement.hasClass('ui-autocomplete-input')) {
autoCompleteElement.autocomplete('destroy');
}
- 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 loadEditor
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
loadEditor(element, customConfig) {
this.setElement(element);
const instance = this.getEditorInstanceFromName();
let config = {
language: CONFIG.langKey,
- 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 registerCopyClipboard
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
registerCopyClipboard: function (container, key = '.clipboard') {
if (typeof container !== 'object' || $(container).length === 0) {
return;
}
container = $(container).get(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 invokeValidation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
*/invokeValidation:function invokeValidation(field,rules,k,options){//If validation engine already maked the field as error
// we dont want to proceed
if("undefined"==typeof options||!0!==options.isError){var listOfValidators=Vtiger_Base_Validator_Js.getValidator(field);for(var i in listOfValidators){var validatorList=listOfValidators[i],validatorName=validatorList.name,validatorInstance=new validatorName,result=void 0;if(validatorInstance.setElement(field),result=validatorList.hasOwnProperty("params")?validatorInstance.validate(validatorList.params):validatorInstance.validate(),!result)return validatorInstance.getError()}}},/**
- 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 setPicklistValues
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function setPicklistValues($values)
{
// Non-Role based picklist values
if (16 === $this->uitype) {
$this->setNoRolePicklistValues($values);
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
validate: function () {
var response = this._super();
if (response !== true) {
return response;
}
- 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 __create
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function __create()
{
\App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
$db = \App\Db::getInstance();
- 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 getCRMRecordMetadata
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function getCRMRecordMetadata($mixedid)
{
$multimode = \is_array($mixedid);
$ids = $multimode ? $mixedid : [$mixedid];
- 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 testGetSourceVariable
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function testGetSourceVariable()
{
$this->assertFalse(\App\TextParser::getInstance('Leads')->setSourceRecord(self::$recordLeads->getId())->getSourceVariable(), 'TextParser::getSourceVariable() should return false for Leads module');
$arr = \App\TextParser::getInstance('Campaigns')->setSourceRecord(self::$recordLeads->getId())->getSourceVariable();
$this->assertIsArray($arr, 'Expected array type');
- 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 findError
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function findError(): void
{
$source = $this->driver->getPageSource();
if (false !== stripos($source, 'YetiError!!!')) {
// @codeCoverageIgnoreStart
- 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 setRelatedList
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function setRelatedList($moduleInstance, $label = '', $actions = false, $functionName = 'getRelatedList', $fieldName = null, $fields = [])
{
$db = \App\Db::getInstance();
if (empty($moduleInstance)) {
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 getColumnsByCvidFromDb
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function getColumnsByCvidFromDb($cvId)
{
\App\Log::trace(__METHOD__ . ' - ' . $cvId);
$columnList = [];
if (is_numeric($cvId)) {
- 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 getRealPathFile
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function getRealPathFile(string $filePath, string $fileExtension, array $layoutPaths): string
{
$realPath = '';
$checkMin = \vtlib\Functions::getMinimizationOptions($fileExtension);
foreach ($layoutPaths as $layoutPath) {
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public function process(): void
{
$this->status = 1;
if (($ip = \App\RequestUtil::getRemoteIP(true)) && ($blackList = \App\Mail\Rbl::findIp($ip, true))) {
foreach ($blackList as $row) {
- 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 setLevels
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function setLevels($levels)
{
if (\is_array($levels)) {
foreach ($levels as $level) {
if (isset(self::$levelMap[$level])) {
- 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 getOrignOrDefaultImgPath
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function getOrignOrDefaultImgPath($imageFileName, $defaultFileName)
{
$basePath = '';
if (!IS_PUBLIC_DIR) {
$basePath = 'public_html/';
- 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 initFieldValuesAuto
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function initFieldValuesAuto()
{
foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
foreach ($this->sourceModuleModel->getFields() as $fieldModel) {
if ('picklist' === $fieldModel->getFieldDataType()) {
- 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 getConditionsFromRequest
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function getConditionsFromRequest(array $conditions): array
{
if (isset($conditions['rules'])) {
foreach ($conditions['rules'] as &$condition) {
if (isset($condition['condition'])) {
- 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 findByRecordNumber
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function findByRecordNumber(array $numbers, string $moduleName, array $fields): array
{
$return = [];
foreach ($numbers as $i => $number) {
if (isset(self::$recordNumberCache[$moduleName][$number])) {
- 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"