Project

General

Profile

Actions

Bug #21616

open

Review RequirePrimaryKeySniff errors

Added by Jeremy Felt 2 months ago. Updated 2 months ago.

Status:
New
Priority name:
Normal
Assignee:
-
Category name:
-
Target version:
Start date:
2024-12-06
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

While working on #21381, I seemed to have accidentally fixed an issue in which PHPCS was not scanning or reporting all issues. I believe it was related to some of the re-ordering and removal of rules via https://github.com/cuny-academic-commons/cac/commit/f1330ec5537aabd4e47d5f428eb7b8accbb004c0

Now that the dust has settled, there are RequirePrimaryKeySniff errors in the following files, which I've temporarily excluded in the PHPCS config:

'plugins/acf-views/prefixed_vendors/vendor/lightsource/acf-groups/src/GroupInfo.php', // Review.
'plugins/better-search/includes/admin/class-activator.php', // Review.
'plugins/chatbot/includes/class-wpwbot-cache.php', // Review.
'plugins/chatbot/includes/class-wpwbot-table.php', // Review.
'plugins/elementor-pro/core/database/base-migration.php', // Review.
'plugins/events-manager/em-install.php', // Review.
'plugins/peters-custom-anti-spam-image/custom_anti_spam.php', // Review.
'plugins/simply-static/src/models/class-ss-model.php', // Review
Actions #1

Updated by Boone Gorges 2 months ago

  • Target version set to 2.6.0

Thanks for this ticket. I've reviewed the list and identified a number of false positives (has to do with some more complex ways of building SQL queries, and/or weird ways that PHPCS tokenizes strings): https://github.com/cuny-academic-commons/cac/commit/243cfa9d255fbbca268b5f39f09f4d327a3673ef

There are a few legitimate items remaining, which I've left with the 'review' label. I'm not going to worry about this for the time being: This sniff was introduced because of some concerns about backup or something that Lihua had when building the current web infrastructure, and these concerns may not carry over to Reclaim. Let's review after the migration.

Actions

Also available in: Atom PDF