Skip to content

v0.0.49

Pre-release
Pre-release

Choose a tag to compare

@RalfKoban RalfKoban released this 17 Sep 09:42
· 1481 commits to master since this release
93510f4

MiKo Analyzers v0.0.49 Release Summary

This release brings a substantial set of improvements, refinements, and new rules to the MiKo Analyzers.

Highlights include:

New Features & Rules

  • Over 30 new analyzer rules added to improve code clarity, naming conventions, and documentation quality.
  • Enhanced support for test method analysis, XML documentation, and naming patterns.
  • New rules targeting abbreviations, collection formatting, and exception handling.

Refactorings & Enhancements

  • Extensive code refactoring for performance, readability, and maintainability.
  • Improved string handling, method naming, and extension methods.
  • Transition from symbol-based to syntax-based analyzers for better performance.

Testing & Coverage

  • Additional unit tests and NCrunch attributes to ensure robustness.
  • Improved test naming detection and async method analysis.

Performance & Optimization

  • Multiple performance tweaks including caching, span usage, and aggressive inlining.
  • Reduced memory allocations and garbage collection overhead.

Dependency Updates

  • Upgraded dependencies including BenchmarkDotNet, log4net, ReportGenerator, and JetBrains Profiler API.
  • Compatibility updates for Visual Studio 2022 v17.14.

Documentation & Cleanup

  • Added and improved XML documentation across the codebase.
  • Applied own rules for code cleanup and style consistency.

What's Changed in detail

  • 'FindTriviaToAnalyze' now has a hardcoded initial capacity by @RalfKoban in #1320
  • 'FirstWordHandling' renamed to 'FirstWordAdjustment' by @RalfKoban in #1413
  • 'GetStartingPhrases' code refactored to use 'string[]' by @RalfKoban in #1490
  • 'MakeFirstWordInfiniteVerb' moved from 'DocumentationCodeFixProvider' into 'Verbalizer' by @RalfKoban in #1298
  • 'MakeLowerCase/MakeUpperCase' renamed to 'StartLowerCase/StartUpperCase' to reflect the meaning by @RalfKoban in #1308
  • AbbreviationsFinder now caches found abbreviations for a given string by @RalfKoban in #1518
  • Added 'AggressiveInlining' hints to methods by @RalfKoban in #1519
  • Added 'in' modifiers by @RalfKoban in #1304
  • Added 'in' modifiers by @RalfKoban in #1305
  • Added 'IsAsciiLetter...' methods by @RalfKoban in #1336
  • Added 'KeyNotFoundException' as known exception type for MiKo_1115 by @RalfKoban in #1256
  • Added 'KeyNotFoundException' as known exception type to MiKo_1117 by @RalfKoban in #1254
  • added [in] modifiers, changed IReadOnlyList to List by @RalfKoban in #1387
  • Added additional tests for properties and fields by @RalfKoban in #1346
  • Added checks for first character to speed up calls by @RalfKoban in #1500
  • Added comments to deactivate NCrunch coverage, changed string comparison to Ordinal by @RalfKoban in #1292
  • Added concurrent dictionary for names with abbreviations by @RalfKoban in #1294
  • Added hints for [MethodImpl(MethodImplOptions.AggressiveInlining)] by @RalfKoban in #1293
  • Added methods 'IsOnSameLineAs' and refactored code to use them by @RalfKoban in #1379
  • Added NCrunch 'Isolated' attribute to AnalyzerTests by @RalfKoban in #1344
  • Added new rule 'MiKo_2235' that reports 'going to' and replaces it with 'will' by @RalfKoban in #1264
  • Added new rule MiKo_1116 that tries to check if test methods are in present tense by @RalfKoban in #1405
  • Added new rule MiKo_1117 that reports inprecise test names by @RalfKoban in #1253
  • Added new rule MiKo_1118 that reports on test methods ending with 'Async' by @RalfKoban in #1312
  • Added new rule MiKo_1510 that reports 'Info' suffix on types by @RalfKoban in #1424
  • Added new rule MiKo_1514 that reports structural names in fields by @RalfKoban in #1526
  • Added new rule MiKo_2230 that reports if return value documentation should better use a '<list>' to describe the return values and their meanings by @RalfKoban in #1402
  • Added new rule MiKo_2236 that reports 'e.g.' and replaces it with 'for example' by @RalfKoban in #1265
  • Added new rule MiKo_2237 for multiple XML documentation by @RalfKoban in #1276
  • Added new rule MiKo_2238 that reports summaries with 'Make sure to call this' by @RalfKoban in #1281
  • Added new rule MiKo_2240 that reports on <response> starting with 'Return' and provides a codefix by @RalfKoban in #1398
  • Added new rule MiKo_2244 that reports <ul> and <ol> and provides a codefix by @RalfKoban in #1452
  • Added new rule MiKo_2313 for comments that should be XML documentation instead by @RalfKoban in #1389
  • Added new rule MiKo_3123 that reports on exceptions being caught in tests by @RalfKoban in #1428
  • Added new rule MiKo_3124 that reports on asserts in 'finally' blocks by @RalfKoban in #1434
  • Added new rule MiKo_3229 that proposes to use 'KeyValuePair.Create' instead by @RalfKoban in #1418
  • Added new rule MiKo_3230 that reports GUID properties or parameters suffixed with 'Id' by @RalfKoban in #1364
  • Added new rule MiKo_5019 for [in] modifier by @RalfKoban in #1415
  • Added new rule MiKo_6063 that reports if invocation is placed on other line and provided fix to place it on same line by @RalfKoban in #1269
  • Added new rule MiKo_6064 for identifier call chains to be placed on same line by @RalfKoban in #1273
  • Added new rule MiKo_6065 that reports outdented dots on invocations by @RalfKoban in #1342
  • Added new rules MiKo_1508 and MiKo_1509 to report 'Adapter', 'Wrapper' and 'Decorator' variable or parameter names by @RalfKoban in #1420
  • Added new rules MiKo_1511 and MiKo_1512 to report 'proxy' variable or parameter names by @RalfKoban in #1425
  • Added null check for incomplete return values to MiKo_3070 and MiKo_3071 by @RalfKoban in #1372
  • Added rule MiKo_2239 that reports /** */ by @RalfKoban in #1348
  • Added rule MiKo_3231 about 'Equals' comparison using 'StringComparison.Ordinal' by @RalfKoban in #1521
  • Added rule MiKo_6066 that reports if collection elements are not indented by @RalfKoban in #1380
  • Added rules MiKo_3227 and MiKo_3228 that check for (in-)equality checks on literals and propose to use 'is' instead by @RalfKoban in #1330
  • Added speculative check for uncompilable code for MiKo_6005 by @RalfKoban in #1391
  • Added test for RDI-off marker by @RalfKoban in #1406
  • Added tests for method 'WithoutMultipleWhiteSpaces' by @RalfKoban in #1295
  • Added uncountable words by @RalfKoban in #1395
  • Added XML documentation and converted methods to expression bodies by @RalfKoban in #1482
  • Added XML documentation by @RalfKoban in #1471
  • Added XML documentation by @RalfKoban in #1483
  • Applied own rules to clean up code by @RalfKoban in #1274
  • Applied own rules to different types by @RalfKoban in #1414
  • Applied rules MiKo_3227 and MiKo_3228 to own code (dogfooding) by @RalfKoban in #1332
  • Bug fixed that let the placeholder show within the message by @RalfKoban in #1279
  • Bumped BenchmarkDotNet version from v0.14 to v0.15 by @RalfKoban in #1350
  • Bumped dependencies to new versions for VS2022 v17.14 by @RalfKoban in #1331
  • bumped log4net and ReportGenerator to latest versions by @RalfKoban in #1525
  • Bumped ReportGenerator version to v5.4.8 by @RalfKoban in #1381
  • Changed arrays to spans where appropriate by @RalfKoban in #1302
  • Changed the default values for the 'StringBuilderCache' by @RalfKoban in #1335
  • Cleaned up code by @RalfKoban in #1367
  • Code cleaned up, applied own rules by @RalfKoban in #1458
  • Code extracted into own methods by @RalfKoban in #1365
  • Code refactored by @RalfKoban in #1369
  • Code refactored to avoid unneeded additional creation when comparing strings by @RalfKoban in #1419
  • Code refactored to speed up performance by @RalfKoban in #1501
  • Code refactored to use 'continue' by @RalfKoban in #1388
  • Code updated to use 'IsWhiteSpaceOnlyText' instead of 'GetTextTrimmed().IsNullOrEmpty()' by @RalfKoban in #1410
  • Comment extensions string array refactoring by @RalfKoban in #1337
  • Complex MiKo_3113 code fix provider method refactored into multiple ones by @RalfKoban in #1371
  • Consolidated and enhanced collection-suffix-detection in MiKo_1040, MiKo_1041 and MiKo_1070, added codefixes by @RalfKoban in #1524
  • Disabled NCrunch RDI in tests by @RalfKoban in #1286
  • Enhanced and refactored ArticleProvider by @RalfKoban in #1363
  • Enhanced MiKo_2230 to detect strange formatting of phrase and avoid multiple spaces in a row by @RalfKoban in #1404
  • Extension methods splitting refactoring by @RalfKoban in #1476
  • Extensions using in keyword by @RalfKoban in #1291
  • Extracted code into own methods by @RalfKoban in #1366
  • Fixed an issue in MiKo_6030 where the braces were placed after all parameters by @RalfKoban in #1280
  • Fixed an issue where MiKo_2237 does not detect commented out code and assumes documentation comments belong together by @RalfKoban in #1277
  • Fixed code so that tests that suddenly fail no longer fail by @RalfKoban in #1407
  • Fixed MiKo_2300/MiKo_2310 violations, adjusted detection of reasoning by @RalfKoban in #1473
  • GetUpdatedSyntax now returns a 'XmlElementSyntax' and not base class 'SyntaxNode' by @RalfKoban in #1252
  • Ignore NDepend files/folders by @RalfKoban in #1309
  • Increased performance of 'IsWhiteSpace' extension method by @RalfKoban in #1353
  • Introduced new rule MiKo_1513 incl. codefix that reports types suffixed with "Advanced", "Complex", "Enhanced", "Extended", "Simple" and "Simplified" by @RalfKoban in #1438
  • JetBrains.Profiler.Api bumped to v1.4.10 by @RalfKoban in #1455
  • JetBrains.Profiler.Api bumped to v1.4.9 by @RalfKoban in #1351
  • Linq Count methods changed into code, switch case oder changed by @RalfKoban in #1306
  • log4net bumped to version 3.1.0 by @RalfKoban in #1314
  • Method 'GetUpdatedSyntax' moved to bottom by @RalfKoban in #1283
  • Method calls changed to extension method invocations as it was before by @RalfKoban in #1463
  • Microsoft.VisualStudio.SDK.Analyzers bumped to 17.7.79 by @RalfKoban in #1352
  • MiKo 2032 fixes some "else" parts at the end by @RalfKoban in #1450
  • MiKo_1018 and Verbalizer are now aware of more nouns convert them into the correct verbs by @RalfKoban in #1431
  • MiKo_1049 is now aware of some more phrases by @RalfKoban in #1375
  • MiKo_1054 is now able to fix 'HandleXyzHelper' into 'XyzHandler' by @RalfKoban in #1360
  • MiKo_1061 no longer reports for multiple out parameters by @RalfKoban in #1390
  • MiKo_1063 is now aware of 'dic' as abbreviation for 'dictionary' by @RalfKoban in #1510
  • MiKo_1063 is now aware of 'elem' as abbreviation for 'element' by @RalfKoban in #1508
  • MiKo_1063 is now aware of 'prev' for 'previous' and 'cur' for 'current by @RalfKoban in #1324
  • MiKo_1063 is now aware of abbreviation 'attr' for 'Attribute' by @RalfKoban in #1503
  • MiKo_1063 is now aware of abbreviation 'dm' for 'Domain Model' by @RalfKoban in #1396
  • MiKo_1063 is now aware of abbreviation 'Seq' and fixes it to 'Sequential' / 'Sequence' by @RalfKoban in #1492
  • MiKo_1063 is now aware of abbreviation 'val'/'Val' for 'value' by @RalfKoban in #1522
  • MiKo_1063 is now aware of abbreviations 'el' and 'ele' for 'element by @RalfKoban in #1507
  • MiKo_1063 is now aware of abbreviations 'len' and 'sess' by @RalfKoban in #1359
  • MiKo_1063 is now aware of abbreviations 'op', 'ops', 'opt' and 'opts' by @RalfKoban in #1412
  • MiKo_1063 now recognizes 'El' as abbreviation for 'Element' by @RalfKoban in #1318
  • MiKo_1063 now reports abbreviation 'exec' by @RalfKoban in #1257
  • MiKo_1070 is now aware of special name 'actual' by @RalfKoban in #1383
  • MiKo_1080 refactored to use 'ReplaceAllWithProbe' by @RalfKoban in #1355
  • MiKo_1107 is now aware of some more phrases by @RalfKoban in #1374
  • MiKo_1115 and MiKo_1117 are now aware of 'JsonException', 'UnauthorizedAccessException' and 'ValidationException' by @RalfKoban in #1327
  • MiKo_1115 can now fix some more phrases by @RalfKoban in #1255
  • MiKo_1115 is now also aware of 'Keep', 'DoesAlter', 'Remove' and 'Accepted' by @RalfKoban in #1373
  • MiKo_1118 is now a unit test analyzer (as intended) by @RalfKoban in #1316
  • MiKo_1118 now also reports test methods ending with '_async' by @RalfKoban in #1317
  • MiKo_2012, MiKo_2019 and MiKo_2039 can now fix some more phrases by @RalfKoban in #1514
  • MiKo_2019 codefix adjusted to change 1st word to a 3rd person singular verb, incl. related adjustments for MiKo_2002 and MiKo_2012 by @RalfKoban in #1249
  • MiKo_2019 is now aware of 'Whether' or 'If' by @RalfKoban in #1504
  • MiKo_2019 no longer tries to change 'Given ' into 3rd person by @RalfKoban in #1282
  • MiKo_2021 is now aware of 'Either the', 'Either a' and 'Either an' when fixing parameter comment by @RalfKoban in #1502
  • MiKo_2031 is now able to fix 'An awaitable Task' resp. 'An awaitable task' by @RalfKoban in #1451
  • MiKo_2031 is now aware of some more phrases by @RalfKoban in #1481
  • MiKo_2035 is now able to detect 'An <see cref="IEnumerable{T}" /> of <see cref="..."/> that contains' by @RalfKoban in #1486
  • MiKo_2035 is now also aware of 'A sequence of ' for IEnumerables by @RalfKoban in #1468
  • MiKo_2035 is now aware of '/// An <see cref="IEnumerable{T}"/> whose elements are the result of ' by @RalfKoban in #1466
  • MiKo_2035 is now aware of 'A <see cref="List{T}"/> containing ' by @RalfKoban in #1469
  • MiKo_2035 now ignores XmlNode return values by @RalfKoban in #1491
  • MiKo_2035 now uses 'A sequence that contains ' for IEnumerable return values by @RalfKoban in #1461
  • MiKo_2040 is now aware of 'nullable' by @RalfKoban in #1478
  • MiKo_2042 no longer reports on '<br/>' by @RalfKoban in #1457
  • MiKo_2060 is now aware of 'creates and sets up' by @RalfKoban in #1261
  • MiKo_2074 is now aware of ' to seek in the ' comments by @RalfKoban in #1460
  • MiKo_2074 is now aware of extension methods by @RalfKoban in #1459
  • MiKo_2080 can now fix some more phrases by @RalfKoban in #1251
  • MiKo_2080 codefix is now aware of some more collection phrases by @RalfKoban in #1263
  • MiKo_2080 codefix is now aware of some more phrases for booleans and collections by @RalfKoban in #1499
  • MiKo_2100 is now aware of <example> documentation starting directly with <code> tags by @RalfKoban in #1409
  • MiKo_2214 is now aware of 2 consequtive empty XML lines by @RalfKoban in #1289
  • MiKo_2218 is now aware of plural texts when fixing 'that can be used in' by @RalfKoban in #1479
  • MiKo_2223 is now aware of 'string.Empty' by @RalfKoban in #1517
  • MiKo_2230 is now aware of XML tags inside the comments to fix by @RalfKoban in #1408
  • MiKo_2236 now also recognizes 'eg.' by @RalfKoban in #1266
  • MiKo_2237 no longer crashs with a NullReferenceException in case of multiline documentation comments /* */ by @RalfKoban in #1326
  • MiKo_3015 can now remove multiple 'InvalidEnumArgumentException' calls at once by @RalfKoban in #1506
  • MiKo_3016 is now aware of 'switch(xyz) case null:' by @RalfKoban in #1464
  • MiKo_3051 now re-uses the trivia from the replaced text so that 'nameof()' is correctly placed by @RalfKoban in #1343
  • MiKo_3060 can now remove multiple 'Debug' or 'Trace' calls at once by @RalfKoban in #1505
  • MiKo_3085 codefix is now aware of declaration expressions by @RalfKoban in #1341
  • MiKo_3118 is now aware of NSubstitute's Arg.Any() by @RalfKoban in #1303
  • MiKo_3123 is now able to fix more phrases by @RalfKoban in #1435
  • MiKo_4002 is now aware of visibility of methods when attempting to place side-by-side by @RalfKoban in #1275
  • MiKo_5017 message and codefix title changed 'to const' by @RalfKoban in #1416
  • MiKo_5017 no longer reports string variables to be constants in case they get re-assigned by @RalfKoban in #1433
  • MiKo_6030 is now aware of initializers placed on same line by @RalfKoban in #1356
  • MiKo_6030 is now aware of more dictionary initializer situations by @RalfKoban in #1378
  • MiKo_6030 now indents dictionary initializer by @RalfKoban in #966
  • MiKo_6040 is now aware of member bindings (Conditional expressions) by @RalfKoban in #1268
  • MiKo_6056 is now aware of some more situations by @RalfKoban in #1376
  • MiKo_6056 now indents implicit object creations by @RalfKoban in #1384
  • MiKo_6063 is now aware of direct invocation call by @RalfKoban in #1340
  • MiKo_6063 no longer reports if invocation has multi-line parameters by @RalfKoban in #1496
  • MiKo_6063 now keeps the leading trivia (whitespaces) from the invocation it updates by @RalfKoban in #1270
  • MiKo_6063 will now underline the expression and not the complete invocation by @RalfKoban in #1272
  • Moved 'Pair' from 'System' namespace into 'MiKoSolutions.Analyzers' namespace by @RalfKoban in #1403
  • Moved check for expression trees inside check for potentially matching nodes to speed up check by avoiding unnecessary calls on non-matching nodes by @RalfKoban in #1429
  • Moved whitespace addition check from MiKo_2019 codefix provider to base provider for shared use by @RalfKoban in #1250
  • Multiple 'PlacedOnSameLine' methods extracted by @RalfKoban in #1271
  • NamesFinder moved into Linguistics namespace by @RalfKoban in #1480
  • Performance improvements by @RalfKoban in #1301
  • Performance improvements by @RalfKoban in #1385
  • Performance improvements by @RalfKoban in #1386
  • Performance improvements by @RalfKoban in #1392
  • Readded threshold to improve performance of substring probes by @RalfKoban in #1358
  • Refactored 'AdjustFirstWord' and moved 'StringExtensions.HasFlag' into 'FirstWordHandlingExtensions' by @RalfKoban in #1300
  • Refactored 'IntersectsWith' and fixed a bug if 2 texts do not overlap but are placed side by side by @RalfKoban in #1362
  • Refactored 'IsApplicable' to get rid of wrong reportings on RS1012 by @RalfKoban in #1446
  • Refactored 'IsTestClass' to detect test types based on naming suffix by @RalfKoban in #1399
  • Refactored 'MidTermHasIssue' to increase performance by @RalfKoban in #1296
  • Refactored 'QuickSubstringProbe' and 'Replace(All)WithProbe' by @RalfKoban in #1357
  • Refactored 'QuickSubstringProbe' to return indices and copy less arrays by @RalfKoban in #1354
  • Refactored 'ReportDiagnostics' calls by @RalfKoban in #1329
  • Refactored 'SyntaxNodeExtensions.IsAnyKind' and extracted method 'IsNested' in MiKo_6040 by @RalfKoban in #1368
  • Refactored analyzers from symbol-based to syntax-based by @RalfKoban in #1442
  • Refactored analyzers from symbol-based to syntax-based by @RalfKoban in #1444
  • Refactored code to increase performance and minimize GC collection times by @RalfKoban in #1311
  • Refactored FindBetterName in analyzers by @RalfKoban in #1443
  • Refactored how parameter comments get build as texts by @RalfKoban in #1465
  • Refactored method 'CollectDots' by @RalfKoban in #1319
  • Refactored MiKo_3122 implementation to work on syntax and not symbols to improve performance by @RalfKoban in #1427
  • Refactored QuickSubstringProbe to improve performance by @RalfKoban in #1382
  • Refactored usage of string comparison for 'StartsWith', 'EndsWith', '… by @RalfKoban in #1445
  • Refactored usage of syntax factory by @RalfKoban in #1430
  • Removed garbage collection that is no longer necessary by @RalfKoban in #1345
  • Removed obsolete note by @RalfKoban in #1361
  • Removed the extra space from the end as that gets added later on by @RalfKoban in #1523
  • Removed unneeded null check & added [in] modifiers by @RalfKoban in #1299
  • Renamed 'ArrayCreationExpressionMaintainabilityAnalyzer' to 'ArrayCreationExpressionPerformanceAnalyzer' by @RalfKoban in #1290
  • Renamed 'diagnostic' parameters to 'issue' by @RalfKoban in #1400
  • Renamed 'FirstWordHandling.KeepLeadingSpace' to 'FirstWordHandling.KeepSingleLeadingSpace' by @RalfKoban in #1313
  • Renamed 'MinLength' to 'MinimumLength' by @RalfKoban in #1495
  • Renamed 'StartIssue' methods to clarify their intent by @RalfKoban in #1278
  • Renamed analyzers and codefixes base classes by @RalfKoban in #1417
  • Renamed variable 'token' in SpacingCodeFixProvider by @RalfKoban in #1285
  • Renamed variables and parameters to better fit their intent by @RalfKoban in #1411
  • Replaced '//// <seealso/>' with '/// <seealso/>' and added '<inheritdoc/>' by @RalfKoban in #1453
  • Replaced 'Array.Resize' with rented arrays to comsume less memory by @RalfKoban in #1349
  • ReportGenerator bumped to v5.4.12 by @RalfKoban in #1456
  • ReportGenerator bumped to version 5.4.7 by @RalfKoban in #1315
  • Sealed classes and refactored Linq call by @RalfKoban in #1370
  • Set severity of some StyleCop rules from 'silent' to 'none' in .editorconfig by @RalfKoban in #1284
  • Simplified 'AdjustFirstWord' methods with if/else logic by @RalfKoban in #1323
  • Split EnumerableExtensions file into different extensions by @RalfKoban in #1472
  • Split SyntaxNodeExtensions file into Documentation extension by @RalfKoban in #1477
  • Switched MiKo_2049 to concurrent dictionary in case of in-parallel calls by @RalfKoban in #1462
  • Test code refactored to limit number of tests and to produce less garbage by @RalfKoban in #1297
  • Update README.md by @RalfKoban in #1259
  • Update README.md by @RalfKoban in #1262
  • Updated description of MiKo_3103 by @RalfKoban in #1401
  • Updated NUnit by @RalfKoban in #1454
  • Updated solution-wide R# settings by @RalfKoban in #1470
  • Updated String builder cache default settings by @RalfKoban in #1338
  • Updated the description of MiKo_1037 to be easier to understand by @RalfKoban in #1334
  • Upgrade 'Microsoft.VisualStudio.Threading.Analyzers' from v17.13.2 to v17.13.61 by @RalfKoban in #1287
  • Upgrade 'ReportGenerator' bumped from v5.4.4 to v5.4.5 by @RalfKoban in #1288
  • Upgrade report generator from 5.4.5 to 5.4.6 by @RalfKoban in #1307

Full Changelog: v0.0.48...v0.0.49