Repository Analysis

dotnet/BenchmarkDotNet

Powerful .NET library for benchmarking

4.8 Likely human-written View on GitHub
4.8
Adjusted Score
4.8
Raw Score
100%
Time Factor
2026-05-30
Last Push
11,419
Stars
C#
Language
120,486
Lines of Code
1283
Files
213
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 7HIGH 67MEDIUM 0LOW 139

Pattern Findings

213 matches across 4 categories. Click a row to expand file-level details.

Cross-File Repetition60 hits · 300 pts
SeverityFileLineSnippet
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0using benchmarkdotnet.running; public class program { public static void main(string[] args) { benchmarkrunner.run{{invo
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0using benchmarkdotnet.running; public class program { public static void main(string[] args) { benchmarkrunner.run{{invo
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0using benchmarkdotnet.running; public class program { public static void main(string[] args) { benchmarkrunner.run{{invo
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0using benchmarkdotnet.running; public class program { public static void main(string[] args) { benchmarkrunner.run{{invo
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0using benchmarkdotnet.running; public class program { public static void main(string[] args) { benchmarkrunner.run{{invo
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0using benchmarkdotnet.running; public class program { public static void main(string[] args) { benchmarkrunner.run{{invo
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0using benchmarkdotnet.running; public class program { public static void main(string[] args) { benchmarkrunner.run{{invo
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0using benchmarkdotnet.running; public class program { public static void main(string[] args) { benchmarkrunner.run{{invo
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2 { }
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor2 : benchmarkclassancestor3 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor2 : benchmarkclassancestor3 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor2 : benchmarkclassancestor3 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor2 : benchmarkclassancestor3 { }
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1<{{typeparameters}}> : benchmarkclassancestor2<{{typeparameters}
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1<{{typeparameters}}> : benchmarkclassancestor2<{{typeparameters}
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1<{{typeparameters}}> : benchmarkclassancestor2<{{typeparameters}
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1<{{typeparameters}}> : benchmarkclassancestor2<{{typeparameters}
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1<{{typeparameters}}> : benchmarkclassancestor2<{{typeparameters}
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor2<{{typeparameters}}> : benchmarkclassancestor3 { }
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor2<{{typeparameters}}> : benchmarkclassancestor3 { }
HIGH…ests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor2<{{typeparameters}}> : benchmarkclassancestor3 { }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass : benchmarkclassancestor1 { {{(uselocalconstants ? $
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass : benchmarkclassancestor1 { {{(uselocalconstants ? $
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass : benchmarkclassancestor1 { {{(uselocalconstants ? $
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass : benchmarkclassancestor1 { {{(uselocalconstants ? $
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass : benchmarkclassancestor1 { {{(uselocalconstants ? $
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass : benchmarkclassancestor1 { {{(uselocalconstants ? $
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass : benchmarkclassancestor1 { {{(uselocalconstants ? $
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass : benchmarkclassancestor1 { {{(uselocalconstants ? $
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass : benchmarkclassancestor1 { {{(uselocalconstants ? $
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass : benchmarkclassancestor1 { {{(uselocalconstants ? $
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass : benchmarkclassancestor1 { {{(uselocalconstants ? $
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2, system.iequatable<benchmarkclassance
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2, system.iequatable<benchmarkclassance
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0public {{abstractmodifier}}class benchmarkclassancestor1 : benchmarkclassancestor2, system.iequatable<benchmarkclassance
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0)}})] [benchmarkcategory({{string.format(valuescontainer,
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0)}})] [benchmarkcategory({{string.format(valuescontainer,
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0)}})] [benchmarkcategory({{string.format(valuescontainer,
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0)}})] [benchmarkcategory({{string.format(valuescontainer,
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0)}})] [benchmarkcategory({{string.format(valuescontainer,
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0)}})] {{baselinebenchmarkattributeusage}} public void baselinebenchmarkmethod3() { } }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0)}})] {{baselinebenchmarkattributeusage}} public void baselinebenchmarkmethod3() { } }
HIGH…s/AnalyzerTests/General/BenchmarkClassAnalyzerTests.cs0)}})] {{baselinebenchmarkattributeusage}} public void baselinebenchmarkmethod3() { } }
HIGH…/Attributes/GeneralParameterAttributesAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass { [{{attributeusage}}] public int property { get; set; } }
HIGH…/Attributes/GeneralParameterAttributesAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass { [{{attributeusage}}] public int property { get; set; } }
HIGH…/Attributes/GeneralParameterAttributesAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass { [{{attributeusage}}] public int property { get; set; } }
HIGH…/Attributes/GeneralParameterAttributesAnalyzerTests.cs0using benchmarkdotnet.attributes; public class benchmarkclass { [{{attributeusage}}] public int property { get; set; } }
HIGH…ributes/BenchmarkCancellationAttributeAnalyzerTests.cs0using system.threading; using benchmarkdotnet.attributes; public class benchmarkclass { [benchmarkcancellation] public c
HIGH…ributes/BenchmarkCancellationAttributeAnalyzerTests.cs0using system.threading; using benchmarkdotnet.attributes; public class benchmarkclass { [benchmarkcancellation] public c
HIGH…ributes/BenchmarkCancellationAttributeAnalyzerTests.cs0using system.threading; using benchmarkdotnet.attributes; public class benchmarkclass { [benchmarkcancellation] public c
Over-Commented Block139 hits · 122 pts
SeverityFileLineSnippet
LOW…onExporterVerifyTests.Exporters_Invariant.verified.txt601# UNIT benchmark_allocated_bytes bytes
LOW…onExporterVerifyTests.Exporters_Invariant.verified.txt621benchmark_gc_gen0_collections_total{method="Bar", type="MockBenchmarkClass"} 0
LOW…CommonExporterVerifyTests.Exporters_ru-RU.verified.txt601# UNIT benchmark_allocated_bytes bytes
LOW…CommonExporterVerifyTests.Exporters_ru-RU.verified.txt621benchmark_gc_gen0_collections_total{method="Bar", type="MockBenchmarkClass"} 0
LOW…agnoser_ExportsAllocatedBytesPerOperation.verified.txt1# HELP benchmark_allocated_bytes Allocated managed memory per single benchmark operation.
LOW…agnoser_ExportsAllocatedBytesPerOperation.verified.txt21benchmark_gc_gen2_collections_total{method="Foo", type="MockBenchmarkClass"} 3
LOW…CommonExporterVerifyTests.Exporters_en-US.verified.txt601# UNIT benchmark_allocated_bytes bytes
LOW…CommonExporterVerifyTests.Exporters_en-US.verified.txt621benchmark_gc_gen0_collections_total{method="Bar", type="MockBenchmarkClass"} 0
LOW…csExporterTests.LabelsAreEscapedCorrectly.verified.txt1# HELP benchmark_error_nanoseconds Standard error of the mean execution time in nanoseconds.
LOW…csExporterTests.LabelsAreEscapedCorrectly.verified.txt21# HELP benchmark_label_with_special_chars_in_the_middle Additional metric label with special !@#$%^&*()chars in the midd
LOW…enchmarkDotNet.IntegrationTests/PowerRequestsParser.cs1namespace BenchmarkDotNet.IntegrationTests;
LOW…enchmarkDotNet.IntegrationTests/PowerRequestsParser.cs21/// [PROCESS] \Device\HarddiskVolume3\...\NoSleep.exe
LOW…s/InProcess.EmitTests.T4/RunnableClassCaseBenchmark.cs1//------------------------------------------------------------------------------
LOW…ts/InProcess.EmitTests.T4/RunnableTaskCaseBenchmark.cs1//------------------------------------------------------------------------------
LOW…ts/InProcess.EmitTests.T4/RunnableVoidCaseBenchmark.cs1//------------------------------------------------------------------------------
LOW…otNet.IntegrationTests/Shared/BenchmarkTestExecutor.cs21 /// <summary>
LOW…tionTests/InProcess.EmitTests/NaiveRunnableEmitDiff.cs101 // Collapse leave-chains. ILGenerator's BeginCatchBlock/EndExceptionBlock unconditionally insert
LOWdocs/articles/samples/IntroSetupCleanupIteration.md21[!code-csharp[IntroSetupCleanupIteration.cs](../../../samples/BenchmarkDotNet.Samples/IntroSetupCleanupIteration.cs)]
LOWdocs/articles/guides/troubleshooting.md1# Troubleshooting
LOW…enchmarkDotNet.Exporters.Plotting/ScottPlotExporter.cs41 /// Gets or sets the width of all plots in pixels.
LOW…enchmarkDotNet.Exporters.Plotting/ScottPlotExporter.cs61 /// Gets or sets a value indicating whether labels for Plot X-axis should be rotated.
LOWsrc/BenchmarkDotNet.TestAdapter/VSTestAdapter.cs201 }
LOW…ibutes/CompilerServices/AggressivelyOptimizeMethods.cs1using System.Runtime.CompilerServices;
LOWsrc/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs21 /// .NET 4.6.1
LOWsrc/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs41 /// .NET 4.7.2
LOWsrc/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs61 /// .NET Core 2.1
LOWsrc/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs81 /// .NET 5.0
LOWsrc/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs101 /// .NET 9.0
LOWsrc/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs121 /// NativeAOT compiled as net7.0
LOWsrc/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs141 /// NativeAOT compiled as net11.0
LOWsrc/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs161 /// WebAssembly with net11.0
LOWsrc/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs181 /// Mono with the Ahead of Time LLVM Compiler backend and net8.0
LOWsrc/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs201 /// .NET 6 using MonoVM (not CLR which is the default)
LOWsrc/BenchmarkDotNet/Environments/Jit.cs1namespace BenchmarkDotNet.Environments
LOWsrc/BenchmarkDotNet/Environments/Platform.cs21 /// ARM
LOWsrc/BenchmarkDotNet/Environments/Platform.cs41 /// LOONGARCH64
LOWsrc/BenchmarkDotNet/Environments/HostEnvironmentInfo.cs41 public Lazy<OsInfo> Os { get; protected set; }
LOW…c/BenchmarkDotNet/Environments/Runtimes/WasmRuntime.cs21 public ArgumentFormatter JavaScriptEngineArgumentFormatter { get; }
LOW…c/BenchmarkDotNet/Environments/Runtimes/WasmRuntime.cs41
LOWsrc/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs781 targetFrameworkMoniker: RuntimeInformation.GetCurrentRuntime().MsBuildMoniker,
LOWsrc/BenchmarkDotNet/Code/CodeGenBenchmarkRunCallType.cs1namespace BenchmarkDotNet.Code;
LOWsrc/BenchmarkDotNet/Code/IParam.cs1namespace BenchmarkDotNet.Code
LOW…enchmarkDotNet/Mathematics/LegacyConfidenceInterval.cs21 /// <summary>
LOW…enchmarkDotNet/Mathematics/LegacyConfidenceInterval.cs41 /// <summary>
LOWsrc/BenchmarkDotNet/Models/BdnExecution.cs21
LOWsrc/BenchmarkDotNet/Models/BdnExecution.cs41 /// Invocation count in a single iteration.
LOWsrc/BenchmarkDotNet/Models/BdnExecution.cs61 /// The default value is 100
LOWsrc/BenchmarkDotNet/Extensions/ReflectionExtensions.cs281
LOWsrc/BenchmarkDotNet/Extensions/ReflectionExtensions.cs361
LOWsrc/BenchmarkDotNet/Diagnosers/IDiagnoser.cs41 /// <summary>
LOWsrc/BenchmarkDotNet/Diagnosers/IDiagnoser.cs61 {
LOW…markDotNet/Diagnosers/InProcessDiagnoserHandlerData.cs1using System.Diagnostics.CodeAnalysis;
LOWsrc/BenchmarkDotNet/Diagnosers/RunMode.cs21 /// no overhead, can be executed without extra run
LOWsrc/BenchmarkDotNet/Diagnosers/EventPipeProfile.cs1namespace BenchmarkDotNet.Diagnosers
LOW…markDotNet/Attributes/DisassemblyDiagnoserAttribute.cs1using BenchmarkDotNet.Configs;
LOWsrc/BenchmarkDotNet/Engines/RunStrategy.cs1namespace BenchmarkDotNet.Engines
LOWsrc/BenchmarkDotNet/Engines/HostSignal.cs21 /// after globalSetup, warmup and pilot but before the main run
LOWsrc/BenchmarkDotNet/Engines/HostSignal.cs41 /// after all (the last thing the benchmarking engine does is to fire this signal)
LOWsrc/BenchmarkDotNet/Configs/ConfigOptions.cs1namespace BenchmarkDotNet.Configs
LOWsrc/BenchmarkDotNet/Configs/ConfigOptions.cs21 StopOnFirstError = 1 << 2,
79 more matches not shown…
Hallucination Indicators7 hits · 100 pts
SeverityFileLineSnippet
CRITICALsrc/BenchmarkDotNet/Helpers/CodeAnnotations.cs1305 /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)</c>.
CRITICALsrc/BenchmarkDotNet/Helpers/CodeAnnotations.cs1323 /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)</c>.
CRITICALsrc/BenchmarkDotNet/Helpers/CodeAnnotations.cs1342 /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String)</c>.
CRITICALsrc/BenchmarkDotNet/Helpers/CodeAnnotations.cs1375 /// <c>System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String)</c>.
CRITICALsrc/BenchmarkDotNet/Helpers/CodeAnnotations.cs1389 /// <c>System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String)</c>.
CRITICALsrc/BenchmarkDotNet/Helpers/CodeAnnotations.cs1397 /// <c>System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String)</c>.
CRITICAL…oolchains/DotNetCli/CustomDotNetCliToolchainBuilder.cs137 System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
Synthetic Comment Markers7 hits · 52 pts
SeverityFileLineSnippet
HIGH…Process.EmitTests.T4/RunnableRefStructCaseBenchmark.cs3// This code was generated by a tool.
HIGH…s/InProcess.EmitTests.T4/RunnableClassCaseBenchmark.cs3// This code was generated by a tool.
HIGH…ts/InProcess.EmitTests.T4/RunnableTaskCaseBenchmark.cs3// This code was generated by a tool.
HIGH…ts/InProcess.EmitTests.T4/RunnableVoidCaseBenchmark.cs3// This code was generated by a tool.
HIGH…nProcess.EmitTests.T4/RunnableManyArgsCaseBenchmark.cs3// This code was generated by a tool.
HIGH…/InProcess.EmitTests.T4/RunnableStructCaseBenchmark.cs3// This code was generated by a tool.
HIGH…Analyzers/BenchmarkDotNetAnalyzerResources.Designer.cs3// This code was generated by a tool.