Content Completeness Index (CCI) calculates a completeness percentage for content based on whether configured fields have values. Site builders can enable it for each content type and assign a weight to each field. The score is the percentage of the total configured weight represented by fields that are filled.
The module stores scores per node revision in a custom table; it does not add a Drupal field type.
The core module currently supports nodes and requires Drupal 11 and PHP 8.2 or later. Its required Drupal dependency is Node. It has no external service or API integrations.
Site builders configure the index at Structure > Content types > [content type] > Completeness Index. They can choose which fields count and set their weights. The module provides a Drupal component for displaying the score in Twig, a floating form block that can show the current score and missing fields while editing, and an administrative batch form and Drush command for rebuilding stored scores. Rebuilds use per-bundle queues, which can be processed immediately, by cron, or manually.
Optional integrations are provided as separate submodules:
- Content Completeness Index - Field Group integration requires Field Group and Simple Multistep. It groups missing fields according to configured field groups and supports multistep forms.
- Content Completeness Index Conditional Validation requires Field Validation. It lets site builders set conditional field weights using Field Validation conditions; the first matching rule applies, and the configured static weight is used when no rule matches.
Comments
Comment #2
vishal.kadamComment #3
avpadernoThank you for applying!
Before giving links helpful to understand how the review process works, what to expect from a review, and what to do to avoid a review takes more time than needed, I would like to thank all the reviewers for the work they do.
These applications are volunters-driven, which also means it is not possible to predict when an application will be marked fixed and the applicant will get the permission to opt projects into security advisory policy. While we aim to make an application as quick as possible, it is also important for us that more people review the project used for an application. In this way, we make sure applications do not miss some important points that should be instead reported.
Applications are not meant to be complete debugging sessions that eliminate every existing bug, though. I apologize if sometimes applications seem to go into too-detailed reviews.
Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.
The important notes are the following.
Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
To the reviewers
Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.
The important notes are the following.
For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.
Comment #4
aftrix commentedI am not a vetted reviewer. This is a volunteer review, so please treat it as input rather than a decision on the application.
1. src/Component/ContentCompletenessComponent.php imports a class that is not in core
The file imports
Drupal\Core\Render\Attribute\Componentand applies#[Component(...)]to the class. I could not find that attribute in Drupal core. On 11.4.7 the namespace holds only two classes:PHPStan reports the same thing:
Single Directory Components are declared with a
*.component.ymlfile rather than a PHP attribute, so I do not think this class is registering anything. Attributes are not resolved unless something reflects them, which is probably why it has not surfaced as an error at runtime. Worth deciding whether the class should become a real SDC, or be removed.2. The preview route is reachable by anonymous users and does not validate the entity type
CompletenessPreviewController::preview()passes$entity_typeand$bundlestraight through toCompletenessIndexPreviewService::calculatePreview(), which calls$this->entityFieldManager->getFieldDefinitions($entity_type, $bundle). Neither value is validated first, so a request naming an entity type that does not exist will throw out of that call rather than return a controlled response.Since
access contentis normally granted to the anonymous role, it is also worth deciding deliberately whether the field labels this returns should be readable by anyone, for any bundle.3. PHP_CodeSniffer
Most of it is mechanical and
phpcbfwill fix it. The two that are not automatic are worth a look by hand:src/Service/CompletenessIndexStorage.php:50, a\Drupalcall inside a class where the service could be injected.src/Hook/EntityHooks.php, fivet()calls that could useStringTranslationTraitand$this->t().4. Branch naming
The application is for 1.0.x, but the repository's default branch is
master, and there is amainbranch as well. The application checklist asks projects to avoidmaster. Setting 1.0.x as the default and removing the branches you are not using would make it clearer which branch is under review.Nothing here looked like an exploitable security problem to me. Points 1 and 2 are the ones I would want to see addressed.
Comment #5
avpadernoComment #6
vishal.kadam1. FILE: README.md
The README file is missing the required section - Installation.
2. FILE: src/Plugin/Block/ContentCompletenessIndexFloatingFormBlock.php, src/Plugin/Block/ContentCompletenessIndexWprogressBlock.php, src/Plugin/QueueWorker/CompletenessRebuildQueueWorker.php
Projects that are compatible with Drupal 10 or higher versions should use attributes instead of annotations.