YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getSoapOptions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getSoapOptions(): array
    {
        $options = [
            'trace' => 1,
            'exceptions' => 1,
Severity: Minor
Found in app/RequestHttp.php - About 35 mins 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 transform has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function transform(array $files, $top = true)
    {
        $rows = [];
        foreach ($files as $name => $file) {
            $subName = $top ? $file['name'] : $name;
Severity: Minor
Found in app/Fields/File.php - About 35 mins 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 getAccessibleUsersForModule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAccessibleUsersForModule()
    {
        $curentUserPrivileges = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
        if ($this->currentUser->isAdmin() || $curentUserPrivileges->hasGlobalWritePermission()) {
            $users = $this->getAccessibleUsers('');
Severity: Minor
Found in app/Fields/Owner.php - About 35 mins 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 updateRolePermissions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateRolePermissions()
    {
        if ($this->valueid && null !== $this->roles) {
            $dbCommand = \App\Db::getInstance()->createCommand();
            $dbCommand->delete('vtiger_role2picklist', ['picklistvalueid' => $this->valueid])->execute();
Severity: Minor
Found in app/Fields/Picklist/Item.php - About 35 mins 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 getAccessibleGroupForModule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAccessibleGroupForModule()
    {
        $curentUserPrivileges = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
        if ($this->currentUser->isAdmin() || $curentUserPrivileges->hasGlobalWritePermission()) {
            $groups = $this->getAccessibleGroups('');
Severity: Minor
Found in app/Fields/Owner.php - About 35 mins 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 getData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getData()
    {
        $data = [];
        foreach (get_object_vars($this) as $name => $value) {
            if (\is_object($value) || 'value' === $name || 'changes' === $name || null === $value) {
Severity: Minor
Found in app/Fields/Picklist/Item.php - About 35 mins 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 checkPermissions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function checkPermissions($record, $moduleName, $userId)
    {
        $privileges = static::get($moduleName);
        if (false === $privileges) {
            return false;
Severity: Minor
Found in app/PrivilegeAdvanced.php - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): int
    {
        $dataReader = (new \App\Db\Query())->from('dbo.FIRMA')
            ->leftJoin('dbo.ADRESY_FIRMY', 'dbo.FIRMA.ID_ADRESU_DOMYSLNEGO = dbo.ADRESY_FIRMY.ID_ADRESY_FIRMY')
            ->where(['>', 'dbo.FIRMA.ID_FIRMY', 0])->createCommand($this->controller->getDb())->query();
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer/MultiCompany.php - About 35 mins 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 loadTemplate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function loadTemplate()
    {
        if (!\file_exists($this->templatePath)) {
            throw new Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||' . $this->templatePath, 406);
        }
Severity: Minor
Found in app/ConfigFile.php - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): int
    {
        $dataReader = (new \App\Db\Query())->select(['dbo.RACHUNEK_FIRMY.*', 'dbo.BANKI.SWIFT', 'bankName' => 'dbo.BANKI.NAZWA'])
            ->from('dbo.RACHUNEK_FIRMY')
            ->leftJoin('dbo.BANKI', 'dbo.RACHUNEK_FIRMY.ID_BANKU = dbo.BANKI.ID_BANKU')
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer/BankAccounts.php - About 35 mins 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 createStatus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function createStatus()
    {
        $status = $this->record->get('activitystatus');
        if ('VEVENT' === (string) $this->vcomponent->name) {
            $values = [
Severity: Minor
Found in app/Integrations/Dav/Calendar.php - About 35 mins 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 findAccount has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function findAccount(array $data, \Vtiger_Record_Model $recordModel): int
    {
        $vatIdField = $recordModel->getModule()->getFieldByName('vat_id');
        if ($vatIdField && $vatIdField->isActiveField() && ($vatId = $data['vat_id_a'] ?: $data['vat_id_b'] ?: false)) {
            if (\App\Cache::staticHas('MagentoFindAccount', $vatId)) {
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Record.php - About 35 mins 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 beforeMethod has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function beforeMethod(RequestInterface $request, ResponseInterface $response)
    {
        file_put_contents(self::DEBUG_FILE, '============ ' . date('Y-m-d H:i:s') . ' ====== Request ======' . PHP_EOL, FILE_APPEND);
        if (\in_array($request->getMethod(), ['PROPFIND', 'REPORT', 'PUT'])) {
            $content = $request->getMethod() . ' ' . $request->getUrl() . ' HTTP/' . $request->getHTTPVersion() . "\r\n";
Severity: Minor
Found in app/Integrations/Dav/Debug.php - About 35 mins 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 convertUnitName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function convertUnitName(string $value, array $params): string
    {
        $value = trim($value, '.');
        $picklistValues = \App\Fields\Picklist::getValuesName($params['fieldName']);
        $return = \in_array($value, $picklistValues);
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer.php - About 35 mins 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 writeHTML has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function writeHTML()
    {
        if ($this->header) {
            $this->pdfOptions['headerTemplate'] = $this->wrapHeaderContent($this->header);
        }
Severity: Minor
Found in app/Pdf/Drivers/Chromium.php - About 35 mins 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 getSubordinateUsers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSubordinateUsers()
    {
        $privilegesModel = $this->get('privileges');

        if (empty($privilegesModel)) {
Severity: Minor
Found in modules/Users/models/Record.php - About 35 mins 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 search has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function search(): array
    {
        $companyId = str_replace([' ', ',', '.', '-'], '', $this->request->getByType('companyId', 'Text'));
        $companyName = $this->request->getByType('companyName', 'Text');
        if (!$this->isActive() || (empty($companyId) && empty($companyName))) {
Severity: Minor
Found in app/RecordCollectors/ChZefix.php - About 35 mins 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 getSize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getSize(): string
    {
        $count = User::getNumberOfUsers();
        $return = 'Micro';
        $last = 0;
Severity: Minor
Found in app/Company.php - About 35 mins 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 consoleIsActive has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function consoleIsActive()
    {
        $ips = \Config\Debug::$DEBUG_CONSOLE_ALLOWED_IPS;
        if (false === $ips || (\is_string($ips) && RequestUtil::getRemoteIP(true) === $ips) || (\is_array($ips) && \in_array(RequestUtil::getRemoteIP(true), $ips))) {
            if (\Config\Debug::$DEBUG_CONSOLE_ALLOWED_USERS && !\in_array(\App\User::getCurrentUserRealId(), \Config\Debug::$DEBUG_CONSOLE_ALLOWED_USERS)) {
Severity: Minor
Found in app/Debuger.php - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate($value, $isUserFormat = false)
    {
        if ($this->validate || empty($value)) {
            return;
        }
Severity: Minor
Found in modules/Users/uitypes/String.php - About 35 mins 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