Stylecop is not reporting all the violations(is there any limit)

May 8, 2012 at 5:32 AM

Stylecop does not analyse all of my files, I tried setting the "Max number of violations" to a big number, even then it ignores some of my projects. It properly scans those projects if I remove some of the files, thus limiting the number of files to be scanned. Please let me know if there is any setting which will allow me to scan everything without any limit.Anuy help would be greatly appreciated

Coordinator
May 8, 2012 at 6:49 AM
Edited May 8, 2012 at 10:11 AM
Try -1 and I'll check the code later when online.

~A.
May 8, 2012 at 7:31 AM

Hi Andy,

Appreciate your prompt reply. I tried your suggestion, but it still does not work.

Does style cop log the operations somewhere?

PS: UI does not allow setting -ve value, however I manually modified the settings file by opening it in visual studio.

Thanks,

Alpee

Coordinator
May 8, 2012 at 10:12 AM

Zero and it wont stop.

May 8, 2012 at 11:10 AM

Hi Andy,

It does not help, after 19950 warnings, it just does not log anything.. Is there any thing else I can try? Is there a way I can enable the log to see why these files are not getting analysed,

I verified that these files are getting added to the StyleCop project:

This is how, I am adding my source files to the project

foreach (string sourceFile in sourceFiles)         

{               

  if (File.Exists(sourceFile))               

 {                   

       Debug.Writeline("Source File":"+ sourceFile);

      bool fileAdded = styleCopConsole.Core.Environment.AddSourceCode(project, sourceFile, null);             

  }           

}

May 8, 2012 at 11:22 AM

Hi Andy,

Is there any limit on number of files that can be scanned by the StyleCop, I removed some of the rules, number of warnings reduced to 15000, but the new files were not picked up?

Thanks,
Alpee 

May 9, 2012 at 4:02 AM

Hi Andy,

Any input for this?

Alpee

May 9, 2012 at 6:36 AM

Hi Andy,

I have 1759 files in my project, I split the number of files into two sets, one of 1000 files and another of 759 files, then i created two instances of StyleCopConsole object passing each instance different set of files and wrote the output to two different xmls, Then it is analyzing all the files properly, so looks like there is restriction on the number of files that can be anlayzed, can you help me with this please?

 

Alpee

Coordinator
May 9, 2012 at 7:55 AM

From VS when you run StyleCop with ReScan All do you eventually see the text 'cancelled' in the output window as its analyzing?

Coordinator
May 9, 2012 at 8:04 AM

I dont know of an code in StyleCop that limits the number of projects or files in the UI for analysis. I've just had another look and there isn't anything in the code to stop it finding projects or adding files. The only time it stops is when is goes past MaxViolationCount.