Category: rscg_demeter
-
Demeter and Roslyn–part 3–config and tests
Beyond the Squiggles: Flexible Reporting and Confidence Through Testing So,we’ve built our Law of Demeter analyzer,RSCG_Demeter,using Roslyn to intelligently spot those overly-chatty code chains,even navigating the complexities of fluent interfaces. We could just have it throw warnings or errors directly in your IDE via Roslyn diagnostics. But let’s be honest,sometimes a flood of new diagnostics…
-
Demeter and Roslyn–part 2- code
Okay,let’s build on the first part and explain the “how” in a more engaging way,weaving in the code snippets to illustrate the process. From Counting Dots to Understanding Code: Building the Demeter Analyzer In the first part,we established our mission: build a Roslyn analyzer to sniff out Law of Demeter violations – stopping our code…
-
Demeter and Roslyn–part 1–idea
Stop Your C# Code Talking to Strangers: Introducing a Law of Demeter Roslyn Analyzer The Law of Demeter (LoD),often summarized as “Only talk to your immediate friends,” is a valuable principle for writing loosely coupled,maintainable code. Code that follows LoD tends to be less fragile and easier to refactor. But manually checking for LoD violations?…