YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function process(App\Request $request)
    {
        $moduleName = $request->getModule();
        $qualifiedModuleName = $request->getModule(false);
        $record = $request->getInteger('record');
Severity: Minor
Found in modules/Settings/OSSMailScanner/views/Folders.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 getListFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListFields(): array
    {
        if (!isset($this->listFieldModels)) {
            $fieldObjects = [];
            $service = $this->getService();
Severity: Minor
Found in modules/Settings/WebserviceUsers/models/Module.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 saveToDb has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveToDb()
    {
        $db = \App\Db::getInstance('admin');
        $fields = array_flip(['providertype', 'isactive', 'api_key', 'parameters', 'name']);
        $tablesData = $this->getId() ? array_intersect_key($this->getData(), $this->changes, $fields) : array_intersect_key($this->getData(), $fields);
Severity: Minor
Found in modules/Settings/SMSNotifier/models/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 checkData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkData()
    {
        if (empty($this->listFields['user_name'])) {
            return false;
        }
Severity: Minor
Found in modules/Settings/WebserviceUsers/models/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 step has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function step($step, App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $qualifiedModuleName = $request->getModule(false);
Severity: Minor
Found in modules/Settings/PDF/views/Edit.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 getFieldInstanceByName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName($name)
    {
        $moduleName = $this->getModule()->getName(true);
        $params = ['uitype' => 1, 'column' => $name, 'name' => $name, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];
        switch ($name) {
Severity: Minor
Found in modules/Settings/SMSNotifier/models/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 dynamic has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function dynamic(App\Request $request): void
    {
        $viewer = $this->getViewer($request);
        $qualifiedModuleName = $request->getModule(false);

Severity: Minor
Found in modules/Settings/FieldsDependency/views/Edit.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 hasModuleActionPermission has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function hasModuleActionPermission($module, $action)
    {
        $actionId = false;
        if (\is_object($action) && is_a($action, 'Vtiger_Action_Model')) {
            $actionId = $action->getId();
Severity: Minor
Found in modules/Settings/Profiles/models/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 getListViewEntries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListViewEntries($pagingModel)
    {
        $module = $this->getModule();
        $parentModuleName = $module->getParentName();
        $qualifiedModuleName = 'PDF';
Severity: Minor
Found in modules/Settings/PDF/models/ListView.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 getPicklistValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getPicklistValue()
    {
        $keys = ['name', 'label', 'value', 'table', 'field'];
        $calendarConfig = [];
        foreach (self::getCalendarColorPicklist() as $picklistName) {
Severity: Minor
Found in modules/Settings/Calendar/models/Module.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 getProfileUtilityPermissions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getProfileUtilityPermissions()
    {
        if (!isset($this->profile_utility_permissions)) {
            $profile2UtilityPermissions = [];
            if ($this->getId()) {
Severity: Minor
Found in modules/Settings/Profiles/models/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 save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function save(): void
    {
        $db = App\Db::getInstance('admin');
        $transaction = $db->beginTransaction();

Severity: Minor
Found in modules/Settings/Companies/models/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 getInstanceById has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getInstanceById($id, $type)
    {
        $cacheName = __CLASS__;
        if (\App\Cache::staticHas($cacheName, $id)) {
            return \App\Cache::staticGet($cacheName, $id);
Severity: Minor
Found in modules/Settings/WebserviceUsers/models/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 getProfileActionPermissions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getProfileActionPermissions()
    {
        if (!isset($this->profile_action_permissions)) {
            $profile2ActionPermissions = [];
            if ($this->getId()) {
Severity: Minor
Found in modules/Settings/Profiles/models/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 getProfileTabFieldPermissions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getProfileTabFieldPermissions($tabId)
    {
        if (!isset($this->profile_tab_field_permissions[$tabId])) {
            $profile2TabFieldPermissions = [];
            if ($this->getId()) {
Severity: Minor
Found in modules/Settings/Profiles/models/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 setFilterPermissions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setFilterPermissions(App\Request $request)
    {
        $user = $request->getByType('user', 'Text');
        $add = $request->getBoolean('operator');

Severity: Minor
Found in modules/Settings/CustomView/actions/SaveAjax.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 getDisplayValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDisplayValue(string $key, $value)
    {
        switch ($key) {
            case 'name':
                $value = \App\Language::translate($value, "Settings:{$value}");
Severity: Minor
Found in modules/Settings/AdminAccess/models/Module.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 add has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function add()
    {
        $table = self::getTableNameFromType($this->getType());
        if ($table) {
            $insertData = [
Severity: Minor
Found in modules/Settings/Inventory/models/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 save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function save($params)
    {
        $db = App\Db::getInstance();
        $name = $params['name'];
        $tabId = (int) $params['tabid'];
Severity: Minor
Found in modules/Settings/Search/models/Module.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(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $qualifiedModuleName = $request->getModule(false);
        $toInstall = \App\YetiForce\Updater::getToInstall();
Severity: Minor
Found in modules/Settings/Updates/views/Index.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