YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getAllByType has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getAllByType($tabid, $type = [], $parameters = false)
    {
        $links = Vtiger_Cache::get('links-' . $tabid, $type);
        if (!$links) {
            $links = parent::getAllByType($tabid, $type, $parameters);
Severity: Minor
Found in modules/Vtiger/models/Link.php - About 1 hr 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 getHistory has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHistory($pagingModel, $type = false)
    {
        if (empty($type)) {
            $type = 'all';
        }
Severity: Minor
Found in modules/Vtiger/models/Module.php - About 1 hr 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 getLabelToDisplay has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getLabelToDisplay(array $row): string
    {
        $name = '';
        $type = $row['type'];
        if (\is_int($type)) {
Severity: Minor
Found in modules/Vtiger/models/Menu.php - About 1 hr 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 getRecordModelFromRequest has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getRecordModelFromRequest(App\Request $request)
    {
        if (empty($this->record)) {
            $this->record = $request->isEmpty('record', true) ? Vtiger_Record_Model::getCleanInstance($request->getModule()) : Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule());
        }
Severity: Minor
Found in modules/Vtiger/actions/Save.php - About 1 hr 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 getRecordDetail has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getRecordDetail(int $recordId, ?int $currencyId, string $moduleName, string $fieldName): array
    {
        $recordModel = Vtiger_Record_Model::getInstanceById($recordId);
        if (!$recordModel->isViewable()) {
            throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
Severity: Minor
Found in modules/Vtiger/actions/Inventory.php - About 1 hr 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 formatDateIntoStrings has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function formatDateIntoStrings($date, $time = false)
    {
        $currentUser = Users_Record_Model::getCurrentUserModel();
        $dateTimeInUserFormat = App\Fields\DateTime::formatToDisplay($date . ' ' . $time);

Severity: Minor
Found in modules/Vtiger/helpers/Util.php - About 1 hr 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 getHistory has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getHistory(App\Request $request, Vtiger_Paging_Model $pagingModel)
    {
        $recordId = $request->getInteger('record');
        if ($request->isEmpty('type')) {
            return [];
Severity: Minor
Found in modules/Vtiger/widgets/HistoryRelation.php - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function get(App\Request $request)
    {
        if ($request->isEmpty('key', 2)) {
            throw new \App\Exceptions\NoPermitted('Not Acceptable', 406);
        }
Severity: Minor
Found in modules/Vtiger/files/MultiImage.php - About 1 hr 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 editViewPreSave has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function editViewPreSave(App\EventHandler $eventHandler)
    {
        $recordModel = $eventHandler->getRecordModel();
        $response = ['result' => true];
        $dataQty = $productsName = [];
Severity: Minor
Found in modules/FInvoice/handlers/CheckingQuantityAvailableProduct.php - About 1 hr 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 editViewPreSave has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function editViewPreSave(App\EventHandler $eventHandler)
    {
        $recordModel = $eventHandler->getRecordModel();
        $response = ['result' => true];
        $values = [];
Severity: Minor
Found in modules/Contacts/handlers/DuplicateEmail.php - About 1 hr 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 getInventoryData has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getInventoryData(XMLReader $xmlToImport, $keyType)
    {
        $recordInventoryData = [];
        $labels = [];
        $columnsName = [];
Severity: Minor
Found in modules/Import/readers/XmlReader.php - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function add(App\Request $request, App\User $user)
    {
        if ($request->get('is_scheduled')) {
            $temp_status = self::$IMPORT_STATUS_SCHEDULED;
        } else {
Severity: Minor
Found in modules/Import/actions/Queue.php - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $data = [];
        $sourceModule = $request->getByType('srcModule');
        $srcModuleModel = Vtiger_Module_Model::getInstance($sourceModule);
Severity: Minor
Found in modules/OpenStreetMap/actions/GetMarkers.php - About 1 hr 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 saveBlockDetails has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        saveBlockDetails: function (form) {
            var aDeferred = $.Deferred();
            var progressIndicatorElement = $.progressIndicator({
                position: 'html',
                blockInfo: {

    Function callback has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                                var callback = function (data) {
                                    var params = app.validationEngineOptions;
                                    params.onValidationComplete = function (form, valid) {
                                        if (valid) {
                                            var progressInstance = jQuery.progressIndicator({
    Severity: Minor
    Found in public_html/layouts/basic/modules/Users/resources/List.js - About 1 hr to fix

      Function updateSelectedFields has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              updateSelectedFields: function (target) {
                  const thisInstance = this;
                  let params = {},
                      relatedModule = $(target).closest('.relatedModule'),
                      progressIndicatorElement = $.progressIndicator({

        Function registerForm has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                registerForm: function () {
                    let form = this.getTabForm();
                    form.on('submit', (event) => {
                        event.preventDefault();
                        form.validationEngine(app.validationEngineOptions);

          Function registerTimeStartChangeEvent has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  registerTimeStartChangeEvent(container) {
                      const thisInstance = this;
                      container.find('input[name="time_start"]').on('change', function (e) {
                          thisInstance.setDefaultEndTime(container);
                      });
          Severity: Minor
          Found in public_html/layouts/basic/modules/Calendar/resources/Edit.js - About 1 hr to fix

            Function registerCacheSettings has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                registerCacheSettings() {
                    const self = this;
                    $('.siteBarRight .filterField').each(function (index) {
                        let name = $(this).attr('id');
                        let value = app.moduleCacheGet(name);

              Function registerCustomViewAdvCondEvents has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  static registerCustomViewAdvCondEvents(listViewContainer) {
                      listViewContainer.on('click', '.js-custom-view-adv-cond-modal', () => {
                          const customViewAdvCond = listViewContainer.find('.js-custom-view-adv-cond');
                          let advancedConditions = customViewAdvCond.val();
                          if (advancedConditions) {
                Severity
                Category
                Status
                Source
                Language