CityOfZion / neo-sharp

Neo-sharp is a new core and node implementation of NEO focused on modular design, best coding practices and testability.
MIT License
34 stars 24 forks source link

Define the Code analysis ProjectRuleSet file #501

Open aboimpinto opened 6 years ago

aboimpinto commented 6 years ago

Now that CodeAnalysis is successful installed in NeoSharp, it's time to define what rules the team want to see enforce by this process.

CoZ doesn't have a RuleSet defined then this could be a great opportunity to envolve @AshRolls to help choose this rules for this project and for all C# projects that CoZ support.

@gubanotorious as NeoSharp project mananger should be involved too and all the member of the team.

This task is a follow up of the #499 and after this should be created a task where the team should clean all the warning. When the application is clean and without warnings we should change CodeAnalys behavior to create compile errors.

aboimpinto commented 6 years ago

I would like to discuss the rule SA 1309: FieldNamesMustNotBeginWithUnderscore

Or we use the underscore to prefix the private fields or we use the prefix "this" StyleCop disallows the use of underscores, m_, etc., to mark local class fields, in favor of the ‘this.’ prefix anyone can read the justification on the link http://stylecop.soyuz5.com/SA1309.html

aboimpinto commented 6 years ago

Another question is regarding the usage of #Region The StyleCop indicate that using #region could hide code and because of that this rules suggest to remove it.

Personally I like the regions because I can group implementations of a interface, all the public methods and all the private methods together (for example) and this can be very helpful to understand the code.