Skip to content

Improving on Filesystem #77

@nochso

Description

@nochso

Currently the Filesystem class is only used by JsonReporter.
However I'd like to suggest extracting an interface from it and letting any scanner related classes use that.
I think it will definitely come in handy with the git version. For example you could avoid checking out entire working directories before scanning them. Instead just implement a GitFilesystem that has access to a repository and implements at least read and fileExists.

That way, scanning huge histories should become quite easy. Use getModifiedFiles of Gitter\Repository to find changed files only. Then use GitFilesystem to retrieve only modified files.
Should there be files that were not changed but still need analyzing (like super classes), GitFilesystem can easily fetch them when this is implement: #73

I'm not too set on "not checking the repository" out, so an alternative could be letting GitFilesystem handle the checkout or clone to a temp directory.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions