ndepend - Tools to Find & Fix C# coding standards -


i using tool called ndepend scan c# solution find coding issues. tool nicely list down coding violations according category. question is, tool give auto suggestion on change should done listed coding issues? cannot find related this.

looking @ list of default ndepend rules, you'll see come 2 comment sections: <description> , <howtofix>. <howtofix> section contains suggestions how fix issues.

this feature came ndepend v6 released in june 2015, maybe using former version?

for example looks like:

// <name>base class should not use derivatives</name>  warnif count > 0  baseclass in justmycode.types baseclass.isclass && baseclass.nbchildren > 0 // <-- optimization! let derivedclassesused = baseclass.derivedtypes.usedby(baseclass) derivedclassesused.count() > 0 select new { baseclass, derivedclassesused }  //<description> // in *object-oriented programming*, **open/closed principle** states: // *software entities (components, classes, methods, etc.) should open  // extension, closed modification*.  // http://en.wikipedia.org/wiki/open/closed_principle // // hence base class should designed make easy derive from, // *extension*. creating new derived class, or modifying // existing one, shouldn't provoke *modification* in base class. // , if base class using derivative classes somehow, there // chances such *modification* needed. // // extending base class not anymore simple operation, // not design. //</description>  //<howtofix> // understand need using derivatives,  // imagine new design, , refactor. // // typically algorithm in base class needs access  // derived classes. can try encapsulate access behind  // abstract or virtual method. // // if see in base class conditions on *typeof(derivedclass)* // not *urgent refactoring* needed. such condition can  // replaced through abstract or virtual method. // // sometime you'll see base class creates instance of derived classes. // in such situation, using *factory method pattern*  // http://en.wikipedia.org/wiki/factory_method_pattern // or *abstract factory pattern*  // http://en.wikipedia.org/wiki/abstract_factory_pattern // improve design.  //</howtofix> 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -