YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
    {
        $info = self::getRecurringInfo($value);
        $text = '';
        if ($info) {
Severity: Minor
Found in modules/Vtiger/uitypes/Recurrence.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 getDBValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDBValue($value, $recordModel = false)
    {
        if ($value) {
            $fieldsModel = $this->getFieldsModel();
            foreach ($value as &$item) {
Severity: Minor
Found in modules/Vtiger/uitypes/MultiDependField.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 editViewChangeValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function editViewChangeValue(App\EventHandler $eventHandler): array
    {
        $return = [];
        $recordModel = $eventHandler->getRecordModel();
        foreach (\App\Fields\Picklist::getDependencyForModule($eventHandler->getModuleName())['conditions'] as $fieldName => $values) {
Severity: Minor
Found in modules/Vtiger/handlers/PicklistDependency.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 setWidgetModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setWidgetModel($widgetModel)
    {
        $this->widgetModel = $widgetModel;
        $this->extraData = App\Json::decode($this->widgetModel->get('data'));
        $this->getTargetModuleModel();
Severity: Minor
Found in modules/Vtiger/models/ChartFilter.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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate($value, $isUserFormat = false)
    {
        if (empty($value) || isset($this->validate[$value])) {
            return;
        }
Severity: Minor
Found in modules/Vtiger/uitypes/Tree.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 getRelatedColumnName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRelatedColumnName($relatedModule, $findModule)
    {
        $relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);
        $relatedModelFields = $relatedModuleModel->getFields();
        foreach ($relatedModelFields as $fieldModel) {
Severity: Minor
Found in modules/Vtiger/models/TransferOwnership.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 getFieldsForView has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldsForView(string $view): array
    {
        $fieldList = [];
        switch ($view) {
            case 'DetailPreview':
Severity: Minor
Found in modules/Vtiger/models/Inventory.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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate($value, $isUserFormat = false)
    {
        if (empty($value) || isset($this->validate[$value])) {
            return;
        }
Severity: Minor
Found in modules/Vtiger/uitypes/Phone.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 getListViewDisplayValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListViewDisplayValue($value, $record = false, $recordModel = false, $rawText = false)
    {
        if ($value && !$rawText) {
            $moduleName = $this->getFieldModel()->get('block')->module->name;
            $fieldName = $this->getFieldModel()->get('name');
Severity: Minor
Found in modules/Vtiger/uitypes/Email.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($value, $record = false, $recordModel = false, $rawText = false, $length = false)
    {
        if ($value && !$rawText) {
            $moduleName = $this->getFieldModel()->get('block')->module->name;
            $fieldName = $this->getFieldModel()->get('name');
Severity: Minor
Found in modules/Vtiger/uitypes/Email.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 getValueToExport has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getValueToExport($value, int $recordId)
    {
        $parts = explode(',', trim($value, ', '));
        $values = \App\Fields\Tree::getValuesById((int) $this->getFieldModel()->getFieldParams());
        foreach ($parts as &$part) {
Severity: Minor
Found in modules/Vtiger/uitypes/Tree.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 loadCondition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadCondition()
    {
        $relatedModuleName = $this->getRelatedModuleModel()->getName();
        $queryGenerator = $this->getRelationModel()->getQueryGenerator();
        if ($entityState = $this->get('entityState')) {
Severity: Minor
Found in modules/Vtiger/models/RelationListView.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 setChartDatasetsColorsMulti has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function setChartDatasetsColorsMulti(&$chartData, $datasetIndex, $dataset, $groupValue, $group, $dividingValue, $dividing)
    {
        if ((!empty($group['color_id']) && !empty($this->colors[$group['color_id']])) || !isset($group['color_id'])) {
            if (!isset($group['color_id'])) {
                // we have all fields colors
Severity: Minor
Found in modules/Vtiger/models/ChartFilter.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 createInventoryTables has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function createInventoryTables()
    {
        $db = \App\Db::getInstance();
        $importer = new \App\Db\Importers\Base();
        $focus = CRMEntity::getInstance($this->getModuleName());
Severity: Minor
Found in modules/Vtiger/models/Inventory.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 getTitle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTitle($prefix = '')
    {
        $title = $this->widgetModel->get('title');
        if (empty($title)) {
            $suffix = '';
Severity: Minor
Found in modules/Vtiger/models/ChartFilter.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 getSideBarLinks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSideBarLinks($linkParams)
    {
        $linkTypes = ['SIDEBARLINK', 'SIDEBARWIDGET'];
        $moduleLinks = $this->getModule()->getSideBarLinks($linkTypes);

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

    public function validate($value, $isUserFormat = false)
    {
        if (empty($value) || isset($this->validate[$value])) {
            return;
        }
Severity: Minor
Found in modules/Vtiger/uitypes/Email.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 iterateAllRows has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function iterateAllRows($callback)
    {
        foreach ($this->rows as $dividingValue => $groupRows) {
            foreach ($groupRows as $groupValue => $group) {
                foreach ($group as $rowIndex => $row) {
Severity: Minor
Found in modules/Vtiger/models/ChartFilter.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 getRecords has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getRecords()
    {
        $selectedRecords = $this->getSelectedRecords();
        $isDeletable = $this->isDeletable();
        if (2 == $this->getRelationType()) {
Severity: Minor
Found in modules/Vtiger/models/TreeCategoryModal.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 getActiveTemplatesForRecord has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getActiveTemplatesForRecord($recordId, $view, $moduleName = false)
    {
        if (!\App\Record::isExists($recordId)) {
            return [];
        }
Severity: Minor
Found in modules/Vtiger/models/PDF.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