Skip to content

Commit

Permalink
New Rule S2094: Classes should not be empty (#6754)
Browse files Browse the repository at this point in the history
  • Loading branch information
zsolt-kolbay-sonarsource committed Feb 21, 2023
1 parent ae96ffa commit be60a31
Show file tree
Hide file tree
Showing 49 changed files with 1,639 additions and 32 deletions.
@@ -0,0 +1,17 @@
{
"issues": [
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\Ember-MM\Ember.Plugins\PluginActionContext.cs",
"region": {
"startLine": 6,
"startColumn": 18,
"endLine": 6,
"endColumn": 37
}
}
}
]
}
95 changes: 95 additions & 0 deletions analyzers/its/expected/Net5/Net5--net5.0-S2094.json
@@ -0,0 +1,95 @@
{
"issues": [
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\Net5\Net5\ModuleInitializers.cs",
"region": {
"startLine": 3,
"startColumn": 18,
"endLine": 3,
"endColumn": 36
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\Net5\Net5\ParameterValidation.cs",
"region": {
"startLine": 3,
"startColumn": 18,
"endLine": 3,
"endColumn": 37
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\Net5\Net5\S2330.cs",
"region": {
"startLine": 5,
"startColumn": 32,
"endLine": 5,
"endColumn": 37
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\Net5\Net5\S3240.cs",
"region": {
"startLine": 5,
"startColumn": 24,
"endLine": 5,
"endColumn": 29
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\Net5\Net5\S3247.cs",
"region": {
"startLine": 8,
"startColumn": 15,
"endLine": 8,
"endColumn": 24
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\Net5\Net5\S3453.cs",
"region": {
"startLine": 22,
"startColumn": 26,
"endLine": 22,
"endColumn": 34
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\Net5\Net5\StaticLambdas.cs",
"region": {
"startLine": 3,
"startColumn": 18,
"endLine": 3,
"endColumn": 31
}
}
}
]
}
17 changes: 17 additions & 0 deletions analyzers/its/expected/Net7/Net7--net7.0-S2094.json
@@ -0,0 +1,17 @@
{
"issues": [
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\Net7\Net7\features\WarningWave7.cs",
"region": {
"startLine": 5,
"startColumn": 22,
"endLine": 5,
"endColumn": 35
}
}
}
]
}
199 changes: 199 additions & 0 deletions analyzers/its/expected/akka.net/Akka--netstandard2.0-S2094.json
@@ -0,0 +1,199 @@
{
"issues": [
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\Actor\ActorSelection.cs",
"region": {
"startLine": 388,
"startColumn": 27,
"endLine": 388,
"endColumn": 47
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\Actor\FSM.cs",
"region": {
"startLine": 202,
"startColumn": 31,
"endLine": 202,
"endColumn": 37
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\Event\LoggerInitialized.cs",
"region": {
"startLine": 15,
"startColumn": 18,
"endLine": 15,
"endColumn": 35
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\Event\Logging.cs",
"region": {
"startLine": 18,
"startColumn": 18,
"endLine": 18,
"endColumn": 44
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\IO\Dns.cs",
"region": {
"startLine": 62,
"startColumn": 31,
"endLine": 62,
"endColumn": 38
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\IO\Inet.cs",
"region": {
"startLine": 229,
"startColumn": 31,
"endLine": 229,
"endColumn": 43
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\IO\Tcp.cs",
"region": {
"startLine": 56,
"startColumn": 33,
"endLine": 56,
"endColumn": 48
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\IO\Tcp.cs",
"region": {
"startLine": 87,
"startColumn": 22,
"endLine": 87,
"endColumn": 29
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\IO\Tcp.cs",
"region": {
"startLine": 738,
"startColumn": 22,
"endLine": 738,
"endColumn": 27
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\IO\Udp.cs",
"region": {
"startLine": 37,
"startColumn": 33,
"endLine": 37,
"endColumn": 48
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\IO\Udp.cs",
"region": {
"startLine": 107,
"startColumn": 31,
"endLine": 107,
"endColumn": 38
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\IO\UdpConnected.cs",
"region": {
"startLine": 95,
"startColumn": 31,
"endLine": 95,
"endColumn": 38
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\Pattern\BackoffOptions.cs",
"region": {
"startLine": 243,
"startColumn": 27,
"endLine": 243,
"endColumn": 38
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\Routing\Listeners.cs",
"region": {
"startLine": 37,
"startColumn": 27,
"endLine": 37,
"endColumn": 42
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka\Routing\RouterMsg.cs",
"region": {
"startLine": 31,
"startColumn": 27,
"endLine": 31,
"endColumn": 50
}
}
}
]
}
@@ -0,0 +1,30 @@
{
"issues": [
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\benchmark\Akka.Benchmarks\IO\TcpOperationsBenchmarks.cs",
"region": {
"startLine": 76,
"startColumn": 22,
"endLine": 76,
"endColumn": 43
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\benchmark\Akka.Benchmarks\IO\TcpOperationsBenchmarks.cs",
"region": {
"startLine": 77,
"startColumn": 22,
"endLine": 77,
"endColumn": 48
}
}
}
]
}
@@ -0,0 +1,30 @@
{
"issues": [
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka.Cluster\ClusterDaemon.cs",
"region": {
"startLine": 281,
"startColumn": 24,
"endLine": 281,
"endColumn": 36
}
}
},
{
"id": "S2094",
"message": "Remove this empty class, or add members to it.",
"location": {
"uri": "sources\akka.net\src\core\Akka.Cluster\ClusterHeartbeat.cs",
"region": {
"startLine": 368,
"startColumn": 23,
"endLine": 368,
"endColumn": 36
}
}
}
]
}

0 comments on commit be60a31

Please sign in to comment.