codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

CodeMaid Crashes on Cleanup of Very Long File

Open RichardWhitfield opened this issue 4 years ago • 1 comments

Environment

  • VS 2019 Community
  • CodeMaid version: 11.2
  • Code language: C#

Description

I have an auto generated csharp file in an OSS project which I am using that has just over 75,000 lines. CodeMaid doesn't seem to be able to cope with this. Not sure if it's worth the time to try and fix this...doesn't seem to be maxing out any specs for CPU or memory, it just crashes. I'll just avoid running CodeMaid on this file for now but it means I can't just use the clean project or clean solution options which is a minor inconvenience.

Steps to recreate

  1. This is the GitHub link to the very long file in question: https://github.com/Autodesk/revit-ifc/blob/master/Source/Revit.IFC.Export/Exporter/ExporterInitializer_PsetDef.cs
  2. Hopefully it's not just my computer that it's killing.

Current behavior

Crashing and not cleaning.

Expected behavior

Not crashing and cleaning.

RichardWhitfield avatar Sep 29 '21 05:09 RichardWhitfield

Thanks for reporting the issue. There definitely is a linear effect from the size of the file to the demands on CPU/memory as it is all processed at once.

A workaround you could use is to add that file to the list of excluded files within options. I believe it's at CodeMaid->Options->Cleaning->File Types where you can specify which files to include/exclude. We do attempt to ignore some auto-generated files (e.g. *.Designer.cs for Windows Forms) since it's generally not helpful to clean them. It sounds like your file would be a good candidate to be excluded!

Hope it helps!

codecadwallader avatar Sep 29 '21 13:09 codecadwallader