Online and CHM
GetQualityViolationsForDirectory Method
Example 



KellermanSoftware.StaticCodeAnalysis Namespace > QualityLogic Class : GetQualityViolationsForDirectory Method
Check the passed directory for code quality issues
Syntax
'Declaration
 
Public Function GetQualityViolationsForDirectory( _
   ByVal directoryPath As String, _
   Optional ByVal baselineViolations As List(Of QualityViolation) _
) As QualityResult
'Usage
 
Dim instance As QualityLogic
Dim directoryPath As String
Dim baselineViolations As List(Of QualityViolation)
Dim value As QualityResult
 
value = instance.GetQualityViolationsForDirectory(directoryPath, baselineViolations)
public QualityResult GetQualityViolationsForDirectory( 
   string directoryPath,
   List<QualityViolation> baselineViolations
)
public:
QualityResult^ GetQualityViolationsForDirectory( 
   String^ directoryPath,
   List<QualityViolation^>^ baselineViolations
) 

Parameters

directoryPath
baselineViolations
Exceptions
ExceptionDescription
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.
The exception that is thrown when part of a file or directory cannot be found.
Example
//Trial Mode
QualityLogic quality = new QualityLogic();
 
//Licensed Mode
//QualityLogic quality = new QualityLogic("User Name from Receipt", "License Key from Receipt");
 
//Test using this open source project:  https://github.com/GregFinzer/Compare-Net-Objects
QualityResult qualityResult =
    quality.GetQualityViolationsForDirectory(@"c:\_git\Compare-Net-Objects\Compare-Net-Objects");
 
string reportPath = Path.Combine(Environment.CurrentDirectory, "QualityResult.html");
quality.ExportViolationsToHtmlReportFile(qualityResult, TemplateName.BlackAndBlue, reportPath);
'Trial Mode
Dim quality As New QualityLogic()
 
'Licensed Mode
'QualityLogic quality = new QualityLogic("User Name from Receipt", "License Key from Receipt");
 
'Test using this open source project:  https://github.com/GregFinzer/Compare-Net-Objects
Dim qualityResult As QualityResult = quality.GetQualityViolationsForDirectory("c:\_git\Compare-Net-Objects\Compare-Net-Objects")
 
Dim reportPath As String = Path.Combine(Environment.CurrentDirectory, "QualityResult.html")
quality.ExportViolationsToHtmlReportFile(qualityResult, TemplateName.BlackAndBlue, reportPath)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

QualityLogic Class
QualityLogic Members