Skip to main content

Count ignored generated code as relevant code

How to review the files Pensero classified as generated or boilerplate code on a work item and, if the classification is wrong, count them as relevant code so the score is recalculated.

Written by Wayne

Pensero automatically detects generated and boilerplate code in a pull request (lock files, migrations, snapshots, scaffolding, repetitive configuration) and leaves it out of the code metrics so the score reflects meaningful work.

Sometimes that classification is wrong: a hand-written file can look generated. When that happens you can tell Pensero to count the file as relevant code and the score is recalculated.

Review what was ignored

  • Open the work item (Work > select the pull request).

  • In the Score breakdown, under Files and lines, click View ignored changes. The link only appears when Pensero ignored something in that pull request.

  • The page lists every ignored file with the exact lines that were left out, all expanded so you can read them at a glance. Back returns you to the work item.

Count files as relevant code

  • Tick the checkbox next to each file that was misclassified, or use Select all files.

  • Click Count selected as relevant code.

  • A confirmation explains what will happen. Click Recalculate.

You are taken back to the work item and the recalculation starts in the background. It usually takes a few minutes.

What is recalculated

  • The selected files stop being treated as generated code for that pull request.

  • The code metrics of the pull request are recomputed.

  • The magnitude, complexity and score of every work item linked to the pull request are recomputed, for the author and for every collaborator.

  • An entry is added to the Activity timeline of each affected work item showing who made the change, which files were counted as relevant, and the score before and after.

While the recalculation is running

The score breakdown shows a Recalculating score badge and the ignored changes page becomes read-only until the recalculation finishes. Reload the work item after a few minutes to see the new score. If more files need to be reverted, do it once the badge disappears.

Important to know

  • The change applies to the pull request, so it affects the work items of everyone who contributed to it, not only yours.

  • It is permanent: files you counted as relevant are never classified as generated code again for that pull request, even if it is reprocessed.

  • Files are reverted as a whole; individual lines cannot be reverted.

  • Reverting cannot be undone from the interface. If you reverted a file by mistake, contact support.

  • To ignore files across the whole organization instead, admins can use exclusion patterns: see Exclude files from Git PR processing.

Did this answer your question?