Showing 4,652 of 306,333 total issues
Function getDataFromApiByNcr
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function getDataFromApiByNcr($ncr): array
{
try {
$response = \App\RequestHttp::getClient()->request('GET', $this->url . '/company/' . $ncr, [
'auth' => [$this->apiKey, ''],
- 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 sendFromTemplate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function sendFromTemplate(array $params): bool
{
Log::trace('Send mail from template', 'Mailer');
if (empty($params['template'])) {
Log::warning('No template', 'Mailer');
- 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 dropForeignKeys
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function dropForeignKeys(array $foreignKeys)
{
$this->logs .= "> start drop foreign keys\n";
$startMain = microtime(true);
$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 checkPermission
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function checkPermission(App\Request $request): bool
{
if ('demo' === App\Config::main('systemMode')) {
throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
}
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$response = new Vtiger_Response();
$bruteForceInstance = Settings_BruteForce_Module_Model::getCleanInstance();
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 recordPreSave
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function recordPreSave(App\Request $request): void
{
$message = '';
$moduleName = $request->getModule();
$checkUserName = 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 process
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$response = new Vtiger_Response();
$bruteForceInstance = Settings_BruteForce_Module_Model::getCleanInstance();
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 getRecordModelsFromRequest
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getRecordModelsFromRequest(App\Request $request)
{
$moduleName = $request->getModule();
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$recordIds = self::getRecordsListFromRequest($request);
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$userModel = \App\User::getCurrentUserModel();
$groupId = $request->getInteger('groupID');
if ($userModel->isAdmin()) {
- 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 getInstance
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getInstance($value, $module = false, $type = '')
{
switch ($type) {
case 'SELF':
$fieldModel = parent::getInstance($value, $module);
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$viewer = $this->getViewer($request);
$bruteForceInstance = Settings_BruteForce_Module_Model::getCleanInstance();
if ($bruteForceInstance->isActive() && $bruteForceInstance->isBlockedIp()) {
- 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 getInstance
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getInstance($qualifiedId)
{
$idComponents = self::getIdComponentsFromQualifiedId($qualifiedId);
$type = $idComponents[0];
$memberId = $idComponents[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 setDataFromRequest
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function setDataFromRequest(App\Request $request)
{
foreach (array_keys($this->getEditFields()) as $field) {
if ($request->has($field)) {
switch ($field) {
- 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 setDataFromRequest
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function setDataFromRequest(App\Request $request)
{
foreach (array_keys($this->getEditFields()) as $field) {
if ($request->has($field)) {
switch ($field) {
- 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 uploadTempFile
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function uploadTempFile(array $files, int $recordId, ?string $hash = null)
{
$db = \App\Db::getInstance();
$attach = [];
$maxSize = $this->getFieldInfo()['maxFileSize'];
- 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 getListViewEntries
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getListViewEntries($pagingModel)
{
$module = $this->getModule();
$moduleName = $module->getName();
$parentModuleName = $module->getParentName();
- 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 createContentMenu
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function createContentMenu($menu)
{
unset($menu['filters']);
$content = $menu['id'] . '=>[';
foreach ($menu as $key => $item) {
- 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 getPagination
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getPagination(App\Request $request)
{
$viewer = $this->getViewer($request);
$pageNumber = $request->getInteger('page');
$searchResult = $request->get('searchResult');
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public static function activate(): bool
{
$importer = new \App\Db\Importers\Base();
$db = \App\Db::getInstance();
if (!$db->isTableExists(\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME)) {
- 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 getPickListView
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getPickListView(App\Request $request)
{
$pickListFields = $picklistValuesName = [];
$sourceModule = $request->getByType('source_module', 2);
$fieldId = $request->getInteger('fieldId');
- 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"