RepoSense
RepoSense copied to clipboard
Dashboard: prevent crash due to excessive diff size
When an author's contribution is beyond a certain size, we need a way to prevent the dashboard crashing if the user tries to view the code of that author.
@damithc Should we impose a limit on the number of lines we can display per file? e.g. if the number of lines of a file has > 5000 lines, we show a message such as:
unable to display large file > 5000 lines, please click on the [here] to view the code.
, where [here]
links to the blame view of the file on GitHub.
Yes, we can limit. If the file is bigger, we can open the code view of that file only in a separate tab? Redirecting to GitHub is not nice because the details we display is different from what GitHub displays.
Hmm there might still be cases where the commits contain extremely large files as below and loading them as a single file might still not be feasible:


Going to the blame view of these files on GitHub will also result in a non-responsive page:
It's fine if an extremely large file cannot be opened but we cannot pre-determine the threshold because it depends on the user's machine. If we warn about the big file and allow the user to open it in a separate tab, if the page fails to load, the user can always kill the tab and go back without losing the entire report?
Closed in view of both https://github.com/reposense/RepoSense/pull/1750 and https://github.com/reposense/RepoSense/pull/1647 being merged which puts limits on the file size being analyzed and limits on the number of characters being displayed when viewing the report which were aimed at solving a similar issue in https://github.com/reposense/RepoSense/issues/1504.