YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function deleteField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function deleteField(string $moduleName, string $fieldName)
    {
        foreach (self::getBoards($moduleName) as $board) {
            foreach (['detail_fields', 'sum_fields'] as $type) {
                if (false !== ($key = array_search($fieldName, $board[$type]))) {
Severity: Minor
Found in app/Utils/Kanban.php - About 25 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 getDatabase has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDatabase()
    {
        if (empty($this->cache['database'])) {
            $this->cache['database'] = \App\Utils\ConfReport::get('database');
        }
Severity: Minor
Found in app/YetiForce/Watchdog.php - About 25 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 getPerformance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPerformance()
    {
        if (empty($this->cache['performance'])) {
            $this->cache['performance'] = \App\Utils\ConfReport::get('performance');
        }
Severity: Minor
Found in app/YetiForce/Watchdog.php - About 25 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 getByType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getByType(array $types, bool $initAll = false): array
    {
        if ($initAll) {
            static::init('all');
        }
Severity: Minor
Found in app/Utils/ConfReport.php - About 25 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 getStability has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getStability()
    {
        if (empty($this->cache['stability'])) {
            $this->cache['stability'] = \App\Utils\ConfReport::get('stability');
        }
Severity: Minor
Found in app/YetiForce/Watchdog.php - About 25 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 getRequest has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function getRequest()
    {
        $requestUrl = static::$crmUrl;
        if (\PHP_SAPI !== 'cli' && !IS_PUBLIC_DIR) {
            $requestUrl .= 'public_html/';
Severity: Minor
Found in app/Utils/ConfReport.php - About 25 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 validateOneOf has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function validateOneOf(string $name, array $row, string $sapi)
    {
        unset($name);
        if (isset($row['values'])) {
            $recommended = $row['values'];
Severity: Minor
Found in app/Utils/ConfReport.php - About 25 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 calculate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function calculate()
    {
        if (!\App\RequestUtil::isNetConnection()) {
            throw new \App\Exceptions\AppException('ERR_NO_INTERNET_CONNECTION');
        }
Severity: Minor
Found in app/Map/Routing/Osrm.php - About 25 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 validateImageContent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function validateImageContent(): bool
    {
        $returnVal = false;
        if (\extension_loaded('imagick')) {
            try {
Severity: Minor
Found in app/Fields/File.php - About 25 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 isDirWriteable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isDirWriteable($dirPath)
    {
        if (is_dir($dirPath)) {
            do {
                $tmpFile = 'tmpfile' . time() . '-' . random_int(1, 1000) . '.tmp';
Severity: Minor
Found in app/Fields/File.php - About 25 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 isActive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function isActive(int $mode): bool
    {
        switch ($mode) {
            case self::MODE_MANUAL:
                $result = !$this->isEmpty('gui');
Severity: Minor
Found in app/AutoAssign.php - About 25 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 generatePassword has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function generatePassword($length = 10, $type = 'lbd')
    {
        $chars = [];
        if (false !== strpos($type, 'l')) {
            $chars[] = 'abcdefghjkmnpqrstuvwxyz';
Severity: Minor
Found in app/Encryption.php - About 25 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 createOrderInCrm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function createOrderInCrm(Maps\Inventory $mapModel)
    {
        $recordModel = \Vtiger_Record_Model::getCleanInstance('SSingleOrders');
        if ($this->config->get('storage_id')) {
            $recordModel->set('istorageaddressid', $this->config->get('storage_id'));
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Order.php - About 25 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 accessModulesByLevel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function accessModulesByLevel($level = 0, $actionName = 'EditView')
    {
        $modules = [];
        if (isset(static::$modulesByLevels[$level])) {
            foreach (static::$modulesByLevels[$level] as $module => &$details) {
Severity: Minor
Found in app/ModuleHierarchy.php - About 25 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 changeFavorites has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function changeFavorites(string $ownerFieldType, int $ownerId): bool
    {
        $userId = $this->currentUser->getId();
        $tabId = \App\Module::getModuleId($this->moduleName);
        $dbCommand = \App\Db::getInstance()->createCommand();
Severity: Minor
Found in app/Fields/Owner.php - About 25 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 getMimeType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMimeType()
    {
        if (empty($this->mimeType)) {
            static::initMimeTypes();
            $extension = $this->getExtension(true);
Severity: Minor
Found in app/Fields/File.php - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $products = [];
        if ('Products' === $this->config->get('storage_quantity_location')) {
            $products = $this->getStockFromProducts();
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/InventoryStock.php - About 25 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 syncProduct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function syncProduct(array $product): int
    {
        $className = $this->config->get('product_map_class') ?: '\App\Integrations\Magento\Synchronizer\Maps\Product';
        $mapModel = new $className($this);
        $mapModel->setData($product);
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Product.php - About 25 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 syncContact has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function syncContact(array $data): int
    {
        $recordModel = \Vtiger_Record_Model::getCleanInstance('Contacts');
        if ($id = $this->findByEmail($data, $recordModel)) {
            $recordModel = \Vtiger_Record_Model::getInstanceById($id, 'Contacts');
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Record.php - About 25 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 isActive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isActive(): bool
    {
        $status = false;
        if (\App\YetiForce\Register::isRegistered() && class_exists('HeadlessChromium\BrowserFactory') && \App\YetiForce\Shop::check('YetiForcePdfPremium')) {
            try {
Severity: Minor
Found in app/Pdf/Drivers/Chromium.php - About 25 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