Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File view has wrong colouring for the first column #926

Closed
CJDennis opened this issue Aug 14, 2022 · 5 comments
Closed

File view has wrong colouring for the first column #926

CJDennis opened this issue Aug 14, 2022 · 5 comments

Comments

@CJDennis
Copy link

CJDennis commented Aug 14, 2022

Q A
php-code-coverage version 9.2.15
PHP version 7.4.24
Driver PCOV
PCOV version (if used) 7.4.13
Installation Method Composer
Usage Method Codeception

The file coverage report still has the method names coloured the same as what is now the last column: Classes and Traits. It should be coloured the same as the second column: Lines.

image

image

In the example screenshot, medium_method should be coloured yellow, just like "Lines" is. This will make "file view" fully consistent with "directory view" where the first column can be any colour, not just red or green. Note that "Total" and the file name / class name lines are currently inconsistent too, being yellow in the directory view and red in the file view. "Total" can't be both red and yellow at the same time!

P.S. The last column (Classes and Traits) possibly shouldn't have any colour for method lines since methods aren't classes or traits. I can make that a separate issue though.

@sebastianbergmann
Copy link
Owner

I am sorry, but I do not understand what you want to report.

@sebastianbergmann
Copy link
Owner

@hemberger Is this related to #900? Thanks!

@hemberger
Copy link
Contributor

I'm happy to take a look and will submit a PR if I can corroborate the issue being reported.

hemberger added a commit to hemberger/php-code-coverage that referenced this issue Aug 19, 2022
Fixes sebastianbergmann#926.

The first column in the HTML Report will now be colored by the "Lines"
coverage level regardless of view (Directory vs. File) or item type
(Directory, File, Class, or Method).

While this is somewhat a matter of preference, I think the following
arguments support this change:

* Prior to sebastianbergmann#900, the first column was always colored the same as the
  second column. This change restores that pattern since the second
  column is always "Lines" as of sebastianbergmann#900.

* In the File view, the first column for Class and Method items were
  colored by "Class" and "Method" coverage respectively. This meant
  that they were only ever 0/1 or 1/1 (red or green). By switching to
  "Lines" coverage for both, the coloring can be more granular.
@CJDennis
Copy link
Author

@sebastianbergmann @hemberger I've updated the issue with screenshots now.

@sebastianbergmann
Copy link
Owner

@sebastianbergmann @hemberger I've updated the issue with screenshots now.

Thank you!

sebastianbergmann pushed a commit that referenced this issue Aug 20, 2022
Fixes #926.

The first column in the HTML Report will now be colored by the "Lines"
coverage level regardless of view (Directory vs. File) or item type
(Directory, File, Class, or Method).

While this is somewhat a matter of preference, I think the following
arguments support this change:

* Prior to #900, the first column was always colored the same as the
  second column. This change restores that pattern since the second
  column is always "Lines" as of #900.

* In the File view, the first column for Class and Method items were
  colored by "Class" and "Method" coverage respectively. This meant
  that they were only ever 0/1 or 1/1 (red or green). By switching to
  "Lines" coverage for both, the coloring can be more granular.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants