Showing 4,652 of 306,333 total issues
Function deleteField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function deleteField(string $moduleName, string $fieldName)
{
foreach (self::getBoards($moduleName) as $board) {
foreach (['detail_fields', 'sum_fields'] as $type) {
if (false !== ($key = array_search($fieldName, $board[$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 getDatabase
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getDatabase()
{
if (empty($this->cache['database'])) {
$this->cache['database'] = \App\Utils\ConfReport::get('database');
}
- 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 getPerformance
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getPerformance()
{
if (empty($this->cache['performance'])) {
$this->cache['performance'] = \App\Utils\ConfReport::get('performance');
}
- 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 getByType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getByType(array $types, bool $initAll = false): array
{
if ($initAll) {
static::init('all');
}
- 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 getStability
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getStability()
{
if (empty($this->cache['stability'])) {
$this->cache['stability'] = \App\Utils\ConfReport::get('stability');
}
- 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 getRequest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function getRequest()
{
$requestUrl = static::$crmUrl;
if (\PHP_SAPI !== 'cli' && !IS_PUBLIC_DIR) {
$requestUrl .= '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 validateOneOf
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function validateOneOf(string $name, array $row, string $sapi)
{
unset($name);
if (isset($row['values'])) {
$recommended = $row['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 calculate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function calculate()
{
if (!\App\RequestUtil::isNetConnection()) {
throw new \App\Exceptions\AppException('ERR_NO_INTERNET_CONNECTION');
}
- 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 validateImageContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function validateImageContent(): bool
{
$returnVal = false;
if (\extension_loaded('imagick')) {
try {
- 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 isDirWriteable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function isDirWriteable($dirPath)
{
if (is_dir($dirPath)) {
do {
$tmpFile = 'tmpfile' . time() . '-' . random_int(1, 1000) . '.tmp';
- 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 isActive
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function isActive(int $mode): bool
{
switch ($mode) {
case self::MODE_MANUAL:
$result = !$this->isEmpty('gui');
- 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 generatePassword
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function generatePassword($length = 10, $type = 'lbd')
{
$chars = [];
if (false !== strpos($type, 'l')) {
$chars[] = 'abcdefghjkmnpqrstuvwxyz';
- 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 createOrderInCrm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function createOrderInCrm(Maps\Inventory $mapModel)
{
$recordModel = \Vtiger_Record_Model::getCleanInstance('SSingleOrders');
if ($this->config->get('storage_id')) {
$recordModel->set('istorageaddressid', $this->config->get('storage_id'));
- 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 accessModulesByLevel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function accessModulesByLevel($level = 0, $actionName = 'EditView')
{
$modules = [];
if (isset(static::$modulesByLevels[$level])) {
foreach (static::$modulesByLevels[$level] as $module => &$details) {
- 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 changeFavorites
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function changeFavorites(string $ownerFieldType, int $ownerId): bool
{
$userId = $this->currentUser->getId();
$tabId = \App\Module::getModuleId($this->moduleName);
$dbCommand = \App\Db::getInstance()->createCommand();
- 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 getMimeType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getMimeType()
{
if (empty($this->mimeType)) {
static::initMimeTypes();
$extension = $this->getExtension(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 process
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function process()
{
$products = [];
if ('Products' === $this->config->get('storage_quantity_location')) {
$products = $this->getStockFromProducts();
- 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 syncProduct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function syncProduct(array $product): int
{
$className = $this->config->get('product_map_class') ?: '\App\Integrations\Magento\Synchronizer\Maps\Product';
$mapModel = new $className($this);
$mapModel->setData($product);
- 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 syncContact
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function syncContact(array $data): int
{
$recordModel = \Vtiger_Record_Model::getCleanInstance('Contacts');
if ($id = $this->findByEmail($data, $recordModel)) {
$recordModel = \Vtiger_Record_Model::getInstanceById($id, 'Contacts');
- 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 isActive
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function isActive(): bool
{
$status = false;
if (\App\YetiForce\Register::isRegistered() && class_exists('HeadlessChromium\BrowserFactory') && \App\YetiForce\Shop::check('YetiForcePdfPremium')) {
try {
- 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"