YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public static function isPermitted(string $moduleName, int $userId = null): bool
    {
        if (null === $userId) {
            $userId = \App\User::getCurrentUserId();
        }
Severity: Minor
Found in app/Security/AdminAccess.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 validateHeaderServer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function validateHeaderServer(string $name, array $row, string $sapi)
    {
        unset($sapi);
        $header = strtolower(\str_replace('Header: ', '', $name));
        $onlyPhp = empty($row['onlyPhp']);
Severity: Minor
Found in app/Utils/ConfReport.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 businessTime has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function businessTime(string $start, string $end, string $startHour, string $endHour, array $days, bool $holidays): int
    {
        $start = new \DateTime($start);
        $end = new \DateTime($end);
        $holidaysDates = $dates = [];
Severity: Minor
Found in app/Utils/ServiceContracts.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 getImages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getImages(): array
    {
        if (null === self::$images) {
            self::$images = [];
            $dataReader = (new \App\Db\Query())->from(static::TABLE_NAME_MEDIA)->where(['status' => 1, 'fieldname' => 'image'])->createCommand()->query();
Severity: Minor
Found in app/Layout/Media.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 getProviders has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getProviders(): array
    {
        $return = [];
        foreach (new \DirectoryIterator(ROOT_DIRECTORY . '/app/Extension/PwnedPassword/') as $item) {
            if ($item->isFile() && 'Base' !== $item->getBasename('.php')) {
Severity: Minor
Found in app/Extension/PwnedPassword.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 getCurrentRoom has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getCurrentRoom()
    {
        $recordId = $_SESSION['chat']['recordId'] ?? null;
        $roomType = $_SESSION['chat']['roomType'] ?? null;
        if (!isset($_SESSION['chat'])) {
Severity: Minor
Found in app/Chat.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 validateHeader has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function validateHeader(string $name, array $row, string $sapi)
    {
        unset($sapi);
        $header = strtolower(\str_replace('Header: ', '', $name));
        if (!empty($row['httpsRequired']) && !\App\RequestUtil::isHttps()) {
Severity: Minor
Found in app/Utils/ConfReport.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 check has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function check(): array
    {
        $result = [];
        if (!\App\YetiForce\Shop::check('YetiForceVulnerabilities')) {
            return $result;
Severity: Minor
Found in app/Security/Dependency.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 relatedRecordsListPrinter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function relatedRecordsListPrinter(\Vtiger_RelationListView_Model $relationListView, \Vtiger_Paging_Model $pagingModel, int $maxLength): string
    {
        $relatedModuleName = $relationListView->getRelationModel()->getRelationModuleName();
        $rows = '';
        $fields = $relationListView->getHeaders();
Severity: Minor
Found in app/EmailParser.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 getDataFromRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDataFromRequest(\App\Request $request): array
    {
        $data = [];
        foreach ($this->getCustomFields() as $fieldName => $fieldModel) {
            if ($request->has($fieldName)) {
Severity: Minor
Found in app/Map/Address/Base.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 findCountryName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function findCountryName(string $value): string
    {
        if (empty($value)) {
            return '';
        }
Severity: Minor
Found in app/Fields/Country.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 formatToDisplay has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function formatToDisplay(?string $value): string
    {
        if (empty($value)) {
            return '0';
        }
Severity: Minor
Found in app/Fields/Integer.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 getModulesByUitype has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getModulesByUitype($uitype)
    {
        switch ($uitype) {
            case 67:
                $level = 0;
Severity: Minor
Found in app/ModuleHierarchy.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 getMembers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMembers(): array
    {
        if (!$this->has('members')) {
            $queryAll = null;
            foreach (self::MEMBERS_TABLES as $tableName => $index) {
Severity: Minor
Found in app/AutoAssign.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 getUitypeByModule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getUitypeByModule($moduleName)
    {
        switch (static::getModuleLevel($moduleName)) {
            case 0:
                $return = 67;
Severity: Minor
Found in app/ModuleHierarchy.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 getMappingRelatedField has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getMappingRelatedField($moduleName)
    {
        $return = false;
        switch ((string) static::getModuleLevel($moduleName)) {
            case '0':
Severity: Minor
Found in app/ModuleHierarchy.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 sanitizeDbFormat has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function sanitizeDbFormat(string $time)
    {
        if ($time) {
            $timeDetails = array_pad(explode(' ', $time), 2, '');
            [$hours, $minutes, $seconds] = array_pad(explode(':', $timeDetails[0]), 3, '00');
Severity: Minor
Found in app/Fields/Time.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 getUsers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getUsers($addBlank = false, $status = 'Active', $assignedUser = '', $private = '', $onlyAdmin = false, $roles = false)
    {
        \App\Log::trace("Entering getUsers($addBlank,$status,$private) method ...");

        $tempResult = $this->initUsers($status, $assignedUser, $private, $roles);
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 getFieldsForListFilter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getFieldsForListFilter(string $moduleName): array
    {
        $fields = [];
        $moduleId = \App\Module::getModuleId($moduleName);
        foreach (static::getHierarchyByRelation() as $relations) {
Severity: Minor
Found in app/ModuleHierarchy.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 getDependencyForModule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getDependencyForModule(string $moduleName)
    {
        if (\App\Cache::has('Picklist::getDependencyForModule', $moduleName)) {
            return \App\Cache::get('Picklist::getDependencyForModule', $moduleName);
        }
Severity: Minor
Found in app/Fields/Picklist.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