YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function parseConditions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private function parseConditions(?array $conditions): array
    {
        if (empty($conditions)) {
            return [];
        }
Severity: Minor
Found in app/QueryGenerator.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 getFieldsFromConditions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getFieldsFromConditions(array $conditions): array
    {
        $fields = ['baseModule' => [], 'referenceModule' => []];
        if (isset($conditions['rules'])) {
            foreach ($conditions['rules'] as &$condition) {
Severity: Minor
Found in app/Condition.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 getBaseGeneralVariable has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getBaseGeneralVariable()
    {
        $variables = [];
        foreach ((new \DirectoryIterator(__DIR__ . \DIRECTORY_SEPARATOR . 'TextParser')) as $fileInfo) {
            $fileName = $fileInfo->getBasename('.php');
Severity: Minor
Found in app/TextParser.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 getLibraryValues has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getLibraryValues($name, $dir): array
    {
        $library = ['name' => $name, 'version' => '', 'license' => '', 'homepage' => ''];
        $existJsonFiles = true;
        foreach (self::$jsonFiles as $file) {
Severity: Minor
Found in app/Installer/Credits.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 getSourceVariable has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSourceVariable()
    {
        if (empty(self::$sourceModules[$this->moduleName])) {
            return false;
        }
Severity: Minor
Found in app/TextParser.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 getModuleGeneralVariable has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getModuleGeneralVariable()
    {
        $variables = [];
        if ($this->moduleName && is_dir(("modules/{$this->moduleName}/textparsers/"))) {
            foreach ((new \DirectoryIterator("modules/{$this->moduleName}/textparsers/")) as $fileInfo) {
Severity: Minor
Found in app/TextParser.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()
    {
        $html = '';
        if (!$this->textParser->recordModel->getModule()->isInventory()) {
            return $html;
Severity: Minor
Found in app/TextParser/ProductsTableDescription.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 getColorByIps has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getColorByIps(array $ips): array
    {
        $return = $find = [];
        foreach ($ips as $uid => $ip) {
            if (\App\Cache::has('MailRblIpColor', $ip)) {
Severity: Minor
Found in app/Mail/Rbl.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 getConfirmResponse has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getConfirmResponse(\App\Request $request): array
    {
        $queries = [
            'base' => $this->getConfirmQuery($request, 'u'),
        ];
Severity: Minor
Found in app/Controller/Components/Action/InterestsConflict.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 parse has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static function parse(string $type)
    {
        $values = [];
        foreach (static::${$type} as $key => $item) {
            if ('cron' === static::$sapi && !$item['testCli']) {
Severity: Minor
Found in app/Utils/ConfReport.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 getSlaPolicyRulesForModule has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getSlaPolicyRulesForModule(\Vtiger_Record_Model $recordModel): array
    {
        $times = $businessHours = [];
        foreach (self::getSlaPolicyForModule($recordModel->getModule()->getId()) as $row) {
            $conditions = \App\Json::decode($row['conditions']);
Severity: Minor
Found in app/Utils/ServiceContracts.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 parseBusinessHoursToDays has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static function parseBusinessHoursToDays(array $rows): array
    {
        $days = $holidays = [];
        foreach ($rows as $row) {
            foreach (explode(',', $row['working_days']) as $day) {
Severity: Minor
Found in app/Utils/ServiceContracts.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 initStorageFileDirectory has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function initStorageFileDirectory($suffix = false)
    {
        if (!$filepath = \App\Config::module($suffix, 'storagePath')) {
            $filepath = 'storage' . \DIRECTORY_SEPARATOR;
        }
Severity: Minor
Found in app/Fields/File.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 explode has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function explode($date, $format = false)
    {
        if (empty($format)) {
            $format = 'yyyy-mm-dd';
        }
Severity: Minor
Found in app/Fields/Date.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 deleteForRecord has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function deleteForRecord(\Vtiger_Record_Model $recordModel)
    {
        foreach ($recordModel->getModule()->getFieldsByType(['multiAttachment', 'multiImage', 'image']) as $fieldModel) {
            if (!$recordModel->isEmpty($fieldModel->getName()) && !\App\Json::isEmpty($recordModel->get($fieldModel->getName()))) {
                foreach (\App\Json::decode($recordModel->get($fieldModel->getName())) as $file) {
Severity: Minor
Found in app/Fields/File.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 getIntervalPart has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getIntervalPart(\DateInterval $dateInterval, string $formatOut = 'ahis')
    {
        $value = 0;
        $parts = str_split($formatOut, 1);
        foreach (['a', 'h', 'i', 's'] as $part) {
Severity: Minor
Found in app/Fields/RangeTime.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 validateValue has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function validateValue(string $fieldName, $value)
    {
        switch ($fieldName) {
            case 'name':
                $itemPropertyModel = $this->getFieldInstanceByName($fieldName);
Severity: Minor
Found in app/Fields/Picklist/Item.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 validate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate(string $key, $value)
    {
        if (!isset($this->template[$key])) {
            throw new Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||' . $key, 406);
        }
Severity: Minor
Found in app/ConfigFile.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 getDataFromApi has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private function getDataFromApi(array $params): void
    {
        try {
            $client = \App\RequestHttp::getClient(['headers' => ['Authorization' => 'Bearer ' . $this->bearerToken]]);
            $response = $client->post($this->url . 'query', ['json' => $params]);
Severity: Minor
Found in app/RecordCollectors/VatifyEu.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 getDataFromApi has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private function getDataFromApi(array $query): void
    {
        $query['limit'] = self::LIMIT;
        try {
            $response = \App\RequestHttp::getClient()->request('GET', $this->url . '?' . http_build_query($query), [
Severity: Minor
Found in app/RecordCollectors/PlCeidg.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