YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function process has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): int
    {
        $query = (new \App\Db\Query())->select([
            'dbo.ARTYKUL.*',
            'category' => 'dbo.KATEGORIA_ARTYKULU_TREE.NAZWA',
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer/Products.php - About 2 hrs 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 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): int
    {
        $query = (new \App\Db\Query())->select([
            'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA',  'ID_DOK_ORYGINALNEGO',
            'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY',
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer/CorrectingInvoice.php - About 2 hrs 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 davSaveAttendee has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function davSaveAttendee(array $record)
    {
        $owner = \Users_Privileges_Model::getInstanceById($record['assigned_user_id']);
        $invities = $this->getInvitations($record['id']);
        $attendees = $this->vcomponent->select('ATTENDEE');
Severity: Minor
Found in app/Integrations/Dav/Calendar.php - About 2 hrs 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 getCombinedUserGlobalPermissions has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getCombinedUserGlobalPermissions($userId)
    {
        if (Cache::staticHas('getCombinedUserGlobalPermissions', $userId)) {
            return Cache::staticGet('getCombinedUserGlobalPermissions', $userId);
        }
Severity: Minor
Found in app/PrivilegeUtil.php - About 2 hrs 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 getValuesForSave has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getValuesForSave()
    {
        $forSave = [
            'vtiger_users' => [
                'date_modified' => date('Y-m-d H:i:s'),
Severity: Minor
Found in modules/Users/models/Record.php - About 2 hrs 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 retrieveEntityInfo has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function retrieveEntityInfo(int $record, string $module)
    {
        \App\Log::trace("Entering into retrieveEntityInfo($record, $module) method.");
        if ('' == $record) {
            \App\Log::error('record is empty. returning null');
Severity: Minor
Found in modules/Users/Users.php - About 2 hrs 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 download has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static function download(string $name): bool
    {
        $returnVal = true;
        if (!static::$libraries[$name]) {
            App\Log::warning('Library does not exist: ' . $name, 'Library');
Severity: Minor
Found in modules/Settings/ModuleManager/models/Library.php - About 2 hrs 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 save has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static function save(Vtiger_PDF_Model $pdfModel, $step = 1)
    {
        $db = \App\Db::getInstance('admin');

        switch ($step) {
Severity: Minor
Found in modules/Settings/PDF/models/Record.php - About 2 hrs 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 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListViewEntries($pagingModel)
    {
        $module = $this->getModule();
        $parentModuleName = $module->getParentName();
        if (!empty($parentModuleName)) {
Severity: Minor
Found in modules/Settings/Mail/models/ListView.php - About 2 hrs 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 step2 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function step2(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $qualifiedModuleName = $request->getModule(false);
Severity: Minor
Found in modules/Settings/Workflows/views/Edit.php - About 2 hrs 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 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $config = OSSMailScanner_Record_Model::getConfig('cron');
        $duration = $config['time'] ?? 0;
        $email = $config['email'] ?? '';
Severity: Minor
Found in modules/OSSMailScanner/crons/Verification.php - About 2 hrs 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 getNextTriggerTimeForAnnualDates has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getNextTriggerTimeForAnnualDates($annualDates, $scheduledTime)
    {
        if ($annualDates) {
            $today = date('Y-m-d');
            $annualDates = \App\Json::decode($annualDates);
Severity: Minor
Found in modules/com_vtiger_workflow/Workflow.php - About 2 hrs 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 getContent has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getContent(): string
    {
        if ($this->has('parsedContent')) {
            return $this->get('parsedContent');
        }
Severity: Minor
Found in modules/OSSMail/models/Mail.php - About 2 hrs 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 getParent has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getParent($id, &$parent, &$encountered, $depthBase = 0)
    {
        \App\Log::trace('Entering getParent(' . $id . ') method ...');
        if ($depthBase == App\Config::module('MultiCompany', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
Severity: Minor
Found in modules/MultiCompany/MultiCompany.php - About 2 hrs 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 getDetailViewRelatedLinks has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDetailViewRelatedLinks()
    {
        $recordModel = $this->getRecord();
        $moduleName = $recordModel->getModuleName();
        $parentModuleModel = $this->getModule();
Severity: Minor
Found in modules/Accounts/models/DetailView.php - About 2 hrs 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 getParent has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0)
    {
        \App\Log::trace('Entering getParent(' . $id . ') method ...');
        if ($depthBase == App\Config::module('Competition', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
Severity: Minor
Found in modules/Competition/Competition.php - About 2 hrs 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 downloadFiles has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static function downloadFiles($recordsIds)
    {
        $zip = new ZipArchive();
        $postfix = time() . '_' . random_int(0, 1000);
        $zipPath = ROOT_DIRECTORY . '/cache/';
Severity: Minor
Found in modules/Documents/models/Record.php - About 2 hrs 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 getDisplayValue has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
    {
        if (empty($value)) {
            return '';
        }
Severity: Minor
Found in modules/Vtiger/uitypes/Owner.php - About 2 hrs 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 validate has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate($value, $isUserFormat = false)
    {
        if (empty($value)) {
            return;
        }
Severity: Minor
Found in modules/Vtiger/uitypes/MultiCurrency.php - About 2 hrs 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 getValueFromImport has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getValueFromImport($value, $defaultValue = null)
    {
        $values = [];
        if ($value) {
            $owners = explode(',', $value);
Severity: Minor
Found in modules/Vtiger/uitypes/SharedOwner.php - About 2 hrs 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