Skip to content

Engineering standards inventory

This page records what the engineering standards program scanned and the conventions it measured. It is written for the people who approve ADR-0105 and ADR-0106: every number in those records comes from here.

Defects found during the scan are listed in the findings register.

Repository families

Family Repositories Examples
Service and solution templates 39 with C# code ConnectSoft.BaseTemplate, ConnectSoft.MicroserviceTemplate, ConnectSoft.WorkerTemplate, ConnectSoft.IdentityTemplate, the SaaS templates
Blazor templates and UI kits 10 with C# code ConnectSoft.Blazor.ShellTemplate, ConnectSoft.Blazor.ComponentLibraryTemplate, ConnectSoft.Blazor.UIKit
Extensions libraries 88 with C# code ConnectSoft.Extensions.*
API clients 29 with C# code ConnectSoft.*.ApiClient
Other ConnectSoft repositories 29 with C# code ConnectSoft.ApiGateway, ConnectSoft.AI.*, ConnectSoft.Sms.*
Consumer services generated from the templates 12 with C# code One client estate, used as a reference consumer. Its repository names are not listed here.

Documentation-only and pipeline repositories (ConnectSoft.Documentation, ConnectSoft.CompanyDocumentation, ConnectSoft.AI.SoftwareFactory.Documentation, ConnectSoft.AzurePipelines, ConnectSoft.AI.AgentKit) were read but have no C# conventions to count.

Method

The counts come from scripts/standards/Measure-ConventionUsage.ps1. The script is read-only and writes its results outside the scanned repositories. Two runs over the same sources gave byte-identical output.

It skips:

  • bin, obj, .git, .vs, node_modules, TestResults, site and artifacts folders;
  • base-template folders, which are git submodule copies of ConnectSoft.BaseTemplate and are counted once in that repository;
  • generated files: *.g.cs, *.designer.cs, AssemblyInfo.cs and GlobalUsings.cs.

What each measure counts:

Measure Unit Rule
Namespace style file namespace X; is file-scoped; namespace X followed by a block is block-scoped.
Using placement file Indented using lines inside a block namespace count as inside; column-0 using lines count as outside.
Private field naming field declaration Non-constant, non-static readonly private fields, split into _name and name.
this. qualification file A file counts when it contains at least one this.member access.
Test method naming test method Methods marked [TestMethod], [DataTestMethod], [Fact], [Theory], [Test] or [TestCase], split by whether the name contains _.
Messaging type naming type Public and internal types in MessagingModel projects, split by the suffixes Event, Command and other.
REST route casing route attribute [Route] and [Http*] templates without their {parameters}, split by whether they contain an uppercase letter.
Packages repository PackageVersion pins in Directory.Packages.props.
Coverage threshold pipeline line Values of codeCoverageThreshold, coverageThreshold and similar keys in pipeline files.

Code conventions

All ConnectSoft repositories (195 with C# code, 21,518 files)

Measure Option A Option B Repositories where A is the majority Repositories where B is the majority
Namespace style block-scoped: 20,239 files file-scoped: 200 files 188 2
Using placement inside namespace: 17,546 files outside namespace: 701 files 185 5
Private fields name: 11,750 _name: 474 154 0
Test names no underscore: 15,803 with underscore: 11,740 132 52
REST routes lowercase: 343 with uppercase: 55 18 8
Messaging types ...Event: 114, ...Command: 23 other suffix: 271 14 5

7,096 of 21,518 files (33%) use this. qualification.

Test naming by family:

Family No underscore With underscore
Templates 5,449 1,750
Extensions 2,536 655
API clients 4,932 3,342
Blazor templates and UI kits 79 4,715
Other 2,807 1,278

Underscore test names are concentrated in the Blazor UI kits and component library, the MAUI repositories and about ten API clients.

Consumer services (12 with C# code, 8,067 files)

Measure Option A Option B
Namespace style block-scoped: 7,808 files file-scoped: 6 files
Using placement inside namespace: 6,855 files outside namespace: 415 files
Private fields name: 4,408 _name: 402
Test names no underscore: 8,357 with underscore: 72
REST routes lowercase: 126 with uppercase: 319
Messaging types ...Event: 62, ...Command: 6 other suffix: 9

3,006 of 8,067 files (37%) use this. qualification.

Stack usage

Repositories that pin each package in Directory.Packages.props:

Package ConnectSoft repositories Versions Consumer services
AutoMapper 5 12.0.1, 13.0.1, 17.0.0 9 (17.0.0)
Mapster 1 10.0.14 0
MassTransit 9 8.2.3, 9.2.6 0
Microsoft.Orleans.Server 3 8.2.0, 10.4.2 9 (10.4.2)
NServiceBus 4 10.2.10 0
NHibernate 10 5.5.2, 5.7.1 -
Reqnroll 4 3.3.4 10
SpecFlow 2 3.9.74 0
Microsoft.Playwright* 4 1.65.1 1
FluentAssertions 18 7.2.2, 8.11.0 -
Swashbuckle.AspNetCore 8 6.7.0 to 10.3.1 -

Source files that import a mapper namespace (using AutoMapper; or using Mapster;): AutoMapper 27 in ConnectSoft and 130 in the consumer services; Mapster 0 in both.

Analyzers and style configuration

Item Count
Repositories pinning StyleCop.Analyzers 161 (versions 1.1.118 and 1.3.180)
Repositories pinning SonarAnalyzer.CSharp 153 (four versions from 9.30 to 10.37)
Repositories pinning Meziantou.Analyzer 153 (six versions from 2.0.163 to 3.0.344)
Repositories where Meziantou or Sonar never load (PackageReference Update only) See ENF-002
Distinct stylecop.json files by content 10 variants across 50 files; 3 set usingDirectivesPlacement to insideNamespace, 2 to outsideNamespace, the rest leave the default
Repositories with TreatWarningsAsErrors set to true 4

Coverage thresholds

Thresholds found in ConnectSoft pipeline files:

Threshold Repositories
0 (no gate) 77
10 to 59 14
60 39
61 to 79 25
80 13
84 to 85 3

The consumer services use 50, 60, 64 and 72. The shared pipeline step defaults to 80 when a repository passes nothing.