YetiForceCompany/YetiForceCRM

View on GitHub

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, ''],
Severity: Minor
Found in app/RecordCollectors/UkCompaniesHouse.php - About 1 hr to fix

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');
Severity: Minor
Found in app/Mailer.php - About 1 hr to fix

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();
Severity: Minor
Found in app/Db/Importer.php - About 1 hr to fix

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);
        }
Severity: Minor
Found in modules/Users/actions/Password.php - About 1 hr to fix

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 {
Severity: Minor
Found in modules/Users/actions/LoginForgotPassword.php - About 1 hr to fix

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;
Severity: Minor
Found in modules/Users/actions/VerifyData.php - About 1 hr to fix

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 {
Severity: Minor
Found in modules/Users/actions/LoginPassChange.php - About 1 hr to fix

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);
Severity: Minor
Found in modules/Users/actions/MassSave.php - About 1 hr to fix

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()) {
Severity: Minor
Found in modules/Users/views/MemberList.php - About 1 hr to fix

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);
Severity: Minor
Found in modules/Settings/MappedFields/models/Field.php - About 1 hr to fix

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()) {
Severity: Minor
Found in modules/Users/views/LoginPassChange.php - About 1 hr to fix

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];
Severity: Minor
Found in modules/Settings/SharingAccess/models/RuleMember.php - About 1 hr to fix

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) {
Severity: Minor
Found in modules/Settings/WebserviceUsers/services/WebserviceStandard.php - About 1 hr to fix

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) {
Severity: Minor
Found in modules/Settings/WebserviceUsers/services/WebservicePremium.php - About 1 hr to fix

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'];
Severity: Minor
Found in modules/Settings/Media/uitypes/Image.php - About 1 hr to fix

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();
Severity: Minor
Found in modules/Settings/Workflows/models/ListView.php - About 1 hr to fix

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) {
Severity: Minor
Found in modules/Settings/Menu/models/Record.php - About 1 hr to fix

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');
Severity: Minor
Found in modules/Settings/Vtiger/views/Pagination.php - About 1 hr to fix

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)) {
Severity: Minor
Found in modules/Settings/Wapro/models/Activation.php - About 1 hr to fix

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');
Severity: Minor
Found in modules/Settings/Colors/views/IndexAjax.php - About 1 hr to fix

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

Severity
Category
Status
Source
Language