Do you know how to laser in on the smelliest code?

Updated by Brady Stroud [SSW] 1 year ago. See history

123
<introEmbed body={<> Rather than randomly browsing for dodgy code, use Visual Studio's Code Metrics feature to identify "Hot Spots" that require investigation. <imageEmbed alt="Image" size="large" showBorder={false} figureEmbed={{ preset: "badExample", figure: 'The bad was is to browse the code', shouldDisplay: true }} src="/uploads/rules/do-you-know-how-to-laser-in-on-the-smelliest-code/lotto-balls.jpeg" /> </>} />
Image

Figure: Run Code Metrics in Visual Studio

Image

Figure: Red dots indicate the code that is hard to maintain. E.g. Save() and LoadCustomer()

Identifying the problem areas is only the start of the process. From here, you should speak to the developers responsible for this dodgy code. There might be good reasons why they haven't invested time on this.

Image

Figure: Find out who the devs are by using CodeLens and start a conversation

Tip: Learn the benefits of Source Control.

Suggestion to Microsoft: Allow us to visualize the developers responsible for the bad code (currently and historically) using CodeLens.

Acknowledgements

Adam Cogan
Damian Brady
Adam Stephensen
Related rules

Need help?

SSW Consulting has over 30 years of experience developing awesome software solutions.

We open source.Loving SSW Rules? Star us on GitHub. Star