YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function getExploded($key, $delimiter = ',', $type = false)
    {
        if (isset($this->purifiedValuesByExploded[$key])) {
            return $this->purifiedValuesByExploded[$key];
        }
Severity: Minor
Found in app/Request.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 getRequestMethod has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getRequestMethod()
    {
        $method = $_SERVER['REQUEST_METHOD'];
        if ('POST' === $method && isset($_SERVER['HTTP_X_HTTP_METHOD'])) {
            if ('DELETE' === $_SERVER['HTTP_X_HTTP_METHOD']) {
Severity: Minor
Found in app/Request.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 preProcess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function preProcess(\App\Request $request, $display = true)
    {
        parent::preProcess($request, false);
        $view = $this->getViewer($request);
        if (\App\Config::performance('BROWSING_HISTORY_WORKING')) {
Severity: Minor
Found in app/Controller/View/Page.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 __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct()
    {
        $browser = \App\RequestUtil::getBrowserInfo();
        $this->headers['Expires'] = gmdate('D, d M Y H:i:s') . ' GMT';
        $this->headers['Last-Modified'] = gmdate('D, d M Y H:i:s') . ' GMT';
Severity: Minor
Found in app/Controller/Headers.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 fromArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function fromArray(array $data)
    {
        $name = $data['name'] ?? '';
        $self = new static($name);
        $self->label = \App\Purifier::purifyByType($data['label'] ?? '', \App\Purifier::TEXT);
Severity: Minor
Found in app/YetiForce/Shop/AbstractBaseProduct.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 get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function get(): array
    {
        $fullVer = \explode('.', \App\Version::get());
        array_pop($fullVer);
        self::$version = \implode('.', $fullVer);
Severity: Minor
Found in app/YetiForce/Updater.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()
    {
        $existLoginHistory = false;
        if (!empty($textParserParams = $this->textParser->getParam('textParserParams')) && isset($textParserParams['userId'])) {
            $userId = $textParserParams['userId'];
Severity: Minor
Found in app/TextParser/UserLoginHistory.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 verify has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function verify(bool $getNames = false): string
    {
        $names = [];
        $products = \App\YetiForce\Register::getProducts();
        foreach ($products ?? [] as $row) {
Severity: Minor
Found in app/YetiForce/Shop.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 getLibraries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getLibraries()
    {
        if (empty($this->cache['libraries'])) {
            $this->cache['libraries'] = \App\Utils\ConfReport::get('libraries');
        }
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 getWritableFilesAndFolders has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getWritableFilesAndFolders()
    {
        if (empty($this->cache['writableFilesAndFolders'])) {
            $this->cache['writableFilesAndFolders'] = \App\Utils\ConfReport::get('writableFilesAndFolders');
        }
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 get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function get(string $type, bool $onlyError = false)
    {
        static::init($type);
        if ($onlyError) {
            $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 send has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function send()
    {
        $config = \App\Config::component('YetiForce');
        if (empty($config['watchdogUrl']) || !\App\RequestUtil::isNetConnection()) {
            return;
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 validateOpenBasedir has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function validateOpenBasedir(string $name, array $row, string $sapi)
    {
        unset($name);
        $row['status'] = true;
        if ('cron' === $sapi) {
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 getParticipants has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getParticipants()
    {
        if (empty($this->recordId) || empty($this->roomType)) {
            return [];
        }
Severity: Minor
Found in app/Chat.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 getChatUsers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getChatUsers(): array
    {
        $owner = Fields\Owner::getInstance();
        $data = [];
        if ($users = $owner->getAccessibleUsers('private', 'owner')) {
Severity: Minor
Found in app/Chat.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 getDiffFromServiceContracts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getDiffFromServiceContracts(string $start, string $end, int $serviceContractId, \Vtiger_Record_Model $recordModel): int
    {
        if ($rules = self::getRulesForServiceContracts($serviceContractId, $recordModel)) {
            if (isset($rules['id'])) {
                return round(\App\Fields\DateTime::getDiff($start, $end, 'minutes'));
Severity: Minor
Found in app/Utils/ServiceContracts.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 validateVersion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function validateVersion(string $name, array $row, string $sapi)
    {
        unset($name);
        $phpVersions = explode(',', $row['recommended']);
        $row['status'] = false;
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 getSecurity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSecurity()
    {
        if (empty($this->cache['security'])) {
            $this->cache['security'] = \App\Utils\ConfReport::get('security');
        }
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 getPublicDirectoryAccess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPublicDirectoryAccess()
    {
        if (empty($this->cache['publicDirectoryAccess'])) {
            $this->cache['publicDirectoryAccess'] = \App\Utils\ConfReport::get('publicDirectoryAccess');
        }
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 validateErrorReporting has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function validateErrorReporting(string $name, array $row, string $sapi)
    {
        unset($name);
        $current = $row[$sapi];
        $errorReporting = false === stripos($current, '_') ? \App\ErrorHandler::error2string($current) : $current;
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

Severity
Category
Status
Source
Language