Sponsored By Aspose - File Format APIs for .NET

Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more!

Category Archives: measurement

Don’t assign a field from many methods

For the next NDepend version, amongst plenty of cool stuff, a new default code rule will be added. It has been named Don’t assign a field from many methods. It falls into the category of Purity – Immutability – Side-Effects rules, one of my preferred set … Continue reading 

Also posted in C#, high cohesion, Immutability, Maintainability | Leave a comment

Rambling on Cyclomatic Complexity

Normal 0 21 false false false FR X-NONE X-NONE After the number of Lines of Code, the Cyclomatic Complexity (CC) is certainly the second most widely used code metric. Here is its definition from Wikipedia : Cyclomatic complexity (or conditional … Continue reading 

Also posted in branch coverage, CC, Code metrics, conditional complexity, conditional statement, coverage, Cyclomatic complexity, linearly independent paths, Lines of Code, LoC, McCabe, software metric, testability, threshold | 5 Comments

Dealing with Code Un-Coverable by Tests

Code UnCoverable by Tests Even for test-coverage addict (as me), there is some code that simply cannot be covered by tests. An example? The call to MessageBox.Show() cannot be tested automatically since it is blocking. Of course we could mock calls to MessageBox.Show(), … Continue reading 

Also posted in Code Coverage, Code metrics, CQL, CQLinq, LoC, Maintainability | 7 Comments