<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Blog posts by Mads Storm Hansen</title><link href="https://world.optimizely.com/blogs/mads-storm-hansen/" /><updated>2019-11-07T08:22:19.0000000Z</updated><id>https://world.optimizely.com/blogs/mads-storm-hansen/</id><generator uri="https://world.optimizely.com/blogs/mads-storm-hansen/" version="2.0">Optimizely World</generator><entry><title>Introducing Code analyzers for Episerver</title><link href="https://world.optimizely.com/blogs/mads-storm-hansen/dates/2019/11/introducing-code-analyzers-for-episerver/" /><id>https://world.optimizely.com/blogs/mads-storm-hansen/dates/2019/11/introducing-code-analyzers-for-episerver/</id><published>2019-11-07T08:22:19.0000000Z</published><updated>2019-11-07T08:22:19.0000000Z</updated><author><name>mads.hansen@valtech.dk</name></author><category term="Blog post" /><summary type="html">&lt;p&gt;&lt;a href="https://nuget.episerver.com/package/?id=CodeAnalyzers.Episerver"&gt;Code analyzers for Episerver&lt;/a&gt; is a new Roslyn-based plugin that analyzes your Episerver code as you type. It can help you avoid some problems with editor experience and code maintainability.&lt;br /&gt;The plugin will show live warnings ("squiggles") in Visual Studio while you are typing.&lt;/p&gt;
&lt;h3&gt;Analyzers&lt;/h3&gt;
&lt;p&gt;Inspired by a &lt;a href="https://www.epinova.no/en/blog/episerver-content-types-hygiene-unit-tests/"&gt;recent blog post&lt;/a&gt;, Code analyzers for Episerver looks for the correct use of content type and property attributes to ensure a good experience for your editors.&lt;a href="https://www.epinova.no/en/blog/episerver-content-types-hygiene-unit-tests/"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The analyzer rules can be configured individually and phased in gradually in a larger codebase.&lt;/p&gt;
&lt;p&gt;&lt;img src="/link/78830ea78e2142259d8f8aa7d254ad70.aspx" /&gt;&lt;/p&gt;
&lt;p&gt;Code analyzers for Episerver also looks for the use of known legacy types and 'Internal' namespaces that should be avoided in your code.&lt;/p&gt;
&lt;p&gt;&lt;img src="/link/ccccafb56bee4aeb88f5fc85fd021acb.aspx" /&gt;&lt;/p&gt;
&lt;h3&gt;Configuration&lt;/h3&gt;
&lt;p&gt;Each analyzer rule severity can be configured in a &lt;a href="https://docs.microsoft.com/visualstudio/code-quality/using-rule-sets-to-group-code-analysis-rules"&gt;ruleset file&lt;/a&gt; similar to Visual Studios built-in code analysis.&lt;/p&gt;
&lt;h3&gt;Installation&lt;/h3&gt;
&lt;p&gt;Code analyzers for Episerver is installed per-project as a NuGet package from the &lt;a href="https://nuget.episerver.com/package/?id=CodeAnalyzers.Episerver"&gt;Episerver feed&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Visual Studio automatically detects and executes the analyzers. Build servers will also execute the analyzer rules on every build.&lt;/p&gt;
&lt;h3&gt;Compatibility&lt;/h3&gt;
&lt;p&gt;Code analyzers for Episerver is compatible with the compilers in Visual Studio 2019 and Visual Studio 2017 (15.5+).&lt;/p&gt;
&lt;p&gt;If your project references an old version of the &lt;a href="https://www.nuget.org/packages/Microsoft.Net.Compilers/"&gt;Microsoft.Net.Compilers&lt;/a&gt; package you may need to upgrade this to 2.6.1+ for compatibility with Code analyzers for Episerver.&lt;/p&gt;</summary></entry></feed>