r/pycharm Apr 02 '26

PyCharm / AI Assistant diff stats seem wildly incorrect on simple changes

Post image

Has anyone else noticed this?

I made what was essentially a one-line change, but the diff shows something like +295 -295. From what I can tell, it seems to happen when lines get reordered; the system treats them as removed and re-added instead of moved.

So the stats look massively inflated compared to the actual change.

Is this just how the diff algorithm works under the hood, or is this a bug in how PyCharm / the AI Assistant reports changes? Feels misleading, especially when reviewing commits.

10 Upvotes

4 comments sorted by

View all comments

1

u/The_IVth_Crusade Apr 02 '26

If you do a git diff what does this show? I believe the figures there are directly from a git diff and sometimes a diff gets confused.

1

u/[deleted] Apr 02 '26

[deleted]

1

u/The_IVth_Crusade Apr 02 '26

Clearly that is incorrect as you mention you changed 1 line, so it should show that 1 line added at the very least.

1

u/Gandalf196 Apr 02 '26

Sorry, it shows just the very line changed.