[policy, no patch] Discuss usage of @codeCoverageIgnore

Created on 30 March 2015, over 10 years ago
Updated 16 May 2025, 3 months ago

Problem/Motivation

PHPUnit's code coverage tool is great, but unfortunately there is code that is:

a) either not unit testable [ procedural function call, external dependency, ... ]
b) a false positive like the ending line of an array according to Drupal's code standards.

As of now there are 2 functions using this annotation in Core.

Proposed resolution

Allow usage of @codeCoverageIgnore annotations on:

- classes
- class functions
- individual lines (for false positives)

Remaining tasks

- Discuss
- Change coding standards (if we want to do this)

User interface changes

- None

API changes

- None

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

base system

Created by

πŸ‡©πŸ‡ͺGermany Fabianx

Live updates comments and jobs are added and updated live.
  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • πŸ‡ΊπŸ‡ΈUnited States neclimdul Houston, TX

    https://docs.phpunit.de/en/12.0/code-coverage.html#ignoring-code-blocks

    Supported in future versions of phpunit so seems its still relevant.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thanks, going to keep the tag for now for stats

Production build 0.71.5 2024