Showing 4,652 of 306,333 total issues
Function showConfirmModal
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
showConfirmModal: function (params) {
let confirmButtonLabel = 'JS_OK';
let rejectedButtonLabel = 'JS_CANCEL';
if (typeof params.confirmButtonLabel !== 'undefined') {
confirmButtonLabel = params.confirmButtonLabel;
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
validate: function (dependentFieldList) {
let thisInstance = this;
let field = this.getElement();
let fieldDateTime = '';
let fieldDateTimeInstance = [];
- 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 getModuleData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getModuleData($mixed)
{
if (empty($mixed)) {
\App\Log::error(__METHOD__ . ' - Required parameter missing');
- 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 updateTool
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function updateTool(ModuleBasic $moduleInstance, $toolAction, $flag, $profileid = false)
{
$actionId = \App\Module::getActionId($toolAction);
if ($actionId) {
$permission = (true === $flag) ? '0' : '1';
- 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 recurseDelete
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function recurseDelete($src, $outsideRoot = false): int
{
$rootDir = ($outsideRoot || 0 === strpos($src, ROOT_DIRECTORY)) ? '' : ROOT_DIRECTORY . \DIRECTORY_SEPARATOR;
if (!file_exists($rootDir . $src)) {
return 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 setEntityIdentifier
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function setEntityIdentifier(FieldBasic $fieldInstance)
{
$db = \App\Db::getInstance();
if ($this->basetableid) {
- 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 getContextMessage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getContextMessage()
{
if (ROOT_DIRECTORY !== getcwd()) {
chdir(ROOT_DIRECTORY);
}
- 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 activate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function activate(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"
Further reading
Function __construct
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($media = '')
{
parent::__construct();
$this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');
- 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 endTest
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function endTest(Test $test, float $time): void
{
if ($this->debug) {
$time = round($time, 2);
echo " - $time second(s) | Assertions: " . $test->getNumAssertions();
- 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 translationModify
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function translationModify(string $language, string $fileName, string $type, string $label, string $translation, bool $remove = false)
{
$fileLocation = explode('__', $fileName, 2);
array_unshift($fileLocation, 'custom', 'languages', $language);
$fileDirectory = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . implode(\DIRECTORY_SEPARATOR, $fileLocation) . '.' . static::FORMAT;
- 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 checkQuickChangerConditions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function checkQuickChangerConditions(array $field, \Vtiger_Record_Model $recordModel)
{
$return = false;
foreach ($field['conditions'] as $fieldName => $value) {
if ($recordModel->get($fieldName) !== $value) {
- 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 updateByType
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function updateByType(string $type): void
{
$types = ['patches', 'version'];
if (!\in_array($this->climate->arguments->get('type'), $types)) {
$this->climate->white('Type not found. Allowed types:')->columns($types);
- 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 isAvailable
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function isAvailable(\Vtiger_Record_Model $recordModel, string $view = '', ?int $userId = null): bool
{
$result = false;
if (null === $userId) {
$userId = \App\User::getCurrentUserId();
- 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 getMultiDimensionArray
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getMultiDimensionArray(string $key, array $template): array
{
$return = [];
if (isset($this->purifiedValuesByMultiDimension[$key])) {
$return = $this->purifiedValuesByMultiDimension[$key];
- 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 employee
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function employee($fieldName)
{
$userId = User::getCurrentUserId();
if (Cache::has('TextParserEmployeeDetail', $userId . $fieldName)) {
return Cache::get('TextParserEmployeeDetail', $userId . $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 getAll
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getAll()
{
if (!\App\RequestUtil::isNetConnection()) {
\App\Log::warning('ERR_NO_INTERNET_CONNECTION', __METHOD__);
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 checkAndConvertJsScripts
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function checkAndConvertJsScripts($jsFileNames)
{
$fileExtension = 'js';
$instances = [];
$min = \App\Config::developer('MINIMIZE_JS');
- 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 checkAndConvertCssStyles
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function checkAndConvertCssStyles($fileNames, $fileExtension = 'css')
{
$instances = [];
$min = \App\Config::developer('MINIMIZE_CSS');
$layoutPaths = \App\Layout::getLayoutPaths();
- 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 parseConditions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function parseConditions(\App\QueryGenerator $queryGenerator, array $searchParams, ?int $userId)
{
foreach ($searchParams as &$conditions) {
if (empty($conditions)) {
continue;
- 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"