Category Archives: CQLinq

Code Rules are not just about Clean Code

Like any developer tool vendor, we at NDepend are eating our own dogfood. In other words, we use NDepend to develop NDepend. Most of default code rules are activated in our development, and they are preventing us daily from all sorts of … Continue reading 

Also posted in Code, code organization, Code Query, Code Rule, CQL, CQL rule, Dead Code | 3 Comments

A Program to explore Code Diff

Recently I answered the question Generating a diff report using NDepend during build on stackoverflow. As explained in my answer, the easy way to go is to follow the documentation on Reporting Code Diff. But for the user that wants something smarter … Continue reading 

Also posted in Change summary, Changes, Code, Code Diff, LINQ | Leave a comment

Ruling Code Quality Regression

A prominent characteristic of the software industry is that products are constantly evolving. All modern development methodologies prone that a product should evolve through small iterations. Internally, development teams are using Continuous Integration servers that shrink increment length to a … Continue reading 

Also posted in API usage, CC, Change summary, Code, code base snapshot comparison, Code Diff, Code Query, Code Rule, code structure, Full Coverage, Immutability, Lines of Code, LINQ, Maintainability, NDepend, software metric, Software Quality Measurement | 1 Comment

Two Screencasts on How to Demystify Spaghetti Code

In my consultant career, no matter the kind of company I visited, from the tiny startup to the largest fortune 500 corporation, they all have in common to be entangled in spaghetti. Spaghetti means poorly structured code. Spaghetti means high maintenance and … Continue reading 

Also posted in .NET assemblies, .NET Framework, .NET Fx, Acyclic componentization, Code Dependency, Component, Cycle, DAG, Dependencies, Dependency Cycle, Dependency Graph, Dependency Matrix, graph of callers, Graph of Dependencies, Indirect Dependency, Pattern, Patterns | 1 Comment

Validating Architecture through LINQ Query

These days we are restructuring the NDepend code base to make it more suited to welcome future features implementation. Here is below the new architecture of the NDepend.UI assembly, made of around 50.000 lines of code, shown through a Dependency Structure … Continue reading 

Also posted in C#, Code Dependency, Code Query, Code Rule, code structure, Code visualization, Dependency Matrix, Layer, LINQ, namespace, namespaces, NDepend, Pattern, Patterns, Performance | 2 Comments

Beware mixing List.Sort() and Thread.Abort()

After more than a decade of full-time development with .NET, I still discover surprising unfixed bugs in the heart of the framework. Today, while I was smoke-testing new stuff in the NDepend UI, I stumbled on an InvalidOperationException thrown by a … Continue reading 

Also posted in .NET Framework, .NET Fx, C#, Code Query, Code Rule | 6 Comments

LINQ Performance: Some Case Studies

One essential requirement while developing Code Query and Rule through LINQ (CQLinq) has been performance, both performance of query compilation and performance of query execution. The reason is simple: we want hundreds of CQLinq rules to be verified right inside Visual Studio in a … Continue reading 

Also posted in LINQ, Performance | 2 Comments

Code Query and Rule over LINQ

Yesterday, after two years of a relentless development effort, we finally released NDepend v4. Personally, I consider this version as the biggest milestone we’ve ever achieved. The three flagship features are: Code query and rule over LINQ (CQLinq) NDepend.API to … Continue reading 

Also posted in Code Query, Code Rule, NDepend, Object oriented programming, VS Integration | 2 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, LoC, Maintainability, measurement | 7 Comments

Layering, the Level metric and the Discourse of Method

When we are discussing the architecture of a code base, we often qualify a piece of code with terms such as high level and low level. This is common vocabulary and we all intuitively know what does it means. A piece of code … Continue reading 

Also posted in .NET assemblies, Afferent Coupling, Application wide, Code metrics, code organization, DAG, Dependency Cycle, Layer, Layering | 2 Comments