1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-04 10:34:59 +02:00
Commit Graph

26 Commits

Author SHA1 Message Date
Mark McDowall
ad60352bae Ignore CA1825 2024-01-12 17:45:32 -08:00
Bogdan
bc374f07ce Use 2 spaces indentation for ts/tsx files 2023-07-17 20:43:52 -07:00
Bogdan
909f2ded6b Standardize variable declaration 2023-05-27 16:55:16 -07:00
Bogdan
c6b543e072 Remove unused imports 2023-05-10 21:08:13 -07:00
Qstick
e8b862a380 Remove Non-Failing Rules 2023-03-15 19:24:48 -05:00
Qstick
2b79fe833b Use Contains(char) instead of Contains(string) for performance 2023-03-15 19:24:48 -05:00
Qstick
4db10e6283 Prefer AsSpan to Substring to avoid unnecessary allocation 2023-03-15 19:24:48 -05:00
Qstick
e8aff90582 Use span-based string.Concat to avoid unnecessary allocation
Calling Substring produces a copy of the extracted substring. By using AsSpan instead of Substring and calling the overload of string.Concat that accepts spans, you can eliminate the unnecessary string allocation.
2023-03-15 19:24:48 -05:00
Qstick
af28bbad52 Use Environment.CurrentManagedThreadId for efficiency
System.Environment.CurrentManagedThreadId is a compact and efficient replacement of the Thread.CurrentThread.ManagedThreadId pattern.
2023-03-15 19:24:48 -05:00
Qstick
f928ee7cad Use Environment.ProcessPath instead of GetCurrentProcess().MainModule.FileName
GetCurrentProcess().MainModule.FileName is expensive, Environment.ProcessPath added in net6
2023-03-15 19:24:48 -05:00
Qstick
7521579bca Use Apend(char) instead of Apend(string) for performance
When calling StringBuilder.Append with a unit length string, consider using a const char rather than a unit length const string to improve performance.
2023-03-15 19:24:48 -05:00
Qstick
e805f61450 Use Length/Count property instead of Count() method to prevent enumerating 2023-03-15 19:24:48 -05:00
Qstick
4fe9daec03 Use Any() in place of Count() to prevent enumerating
This rule flags the Count and LongCount LINQ method calls used to check if the collection has at least one element. These method calls require enumerating the entire collection to compute the count. The same check is faster with the Any method as it avoids enumerating the collection.
2023-03-15 19:24:48 -05:00
Qstick
738dc2c98c Do not use Enumerable methods on indexable collections
This rule flags the Enumerable LINQ method calls on collections of types that have equivalent but more efficient properties to fetch the same data.
2023-03-15 19:24:48 -05:00
Qstick
0ed8ba828d Avoid unnecessary zero-length array allocations 2023-03-15 19:24:48 -05:00
Qstick
b2c2c79a96 Don't compare strings to Empty using Equals
Comparing strings using the String.Length property or the String.IsNullOrEmpty method is faster than using Equals. This is because Equals executes significantly more MSIL instructions than either IsNullOrEmpty or the number of instructions executed to retrieve the Length property value and compare it to zero.
2023-03-15 19:24:48 -05:00
Qstick
08ee2f7e32 Remove unnecessary assignments to default type value
The .NET runtime initializes all fields of reference types to their default values before running the constructor. In most cases, explicitly initializing a field to its default value in a constructor is redundant, adding maintenance costs and potentially degrading performance
2023-03-15 19:24:48 -05:00
Qstick
42e45f93ac Use const where appropriate
The value of a const field is computed at compile time and stored in the metadata, which improves run-time performance when it is compared to a static readonly field.
2023-03-15 19:24:48 -05:00
Qstick
b4d8f0c311 Enable all analyzers and enforce code style on build 2023-03-15 19:24:48 -05:00
Qstick
08b677ca7d Enforce comment spacing with Stylecop 2022-11-21 16:58:07 -08:00
Qstick
4c0fe62dda Use modern HttpClient
Co-Authored-By: ta264 <ta264@users.noreply.github.com>
2022-08-07 15:24:37 -07:00
Qstick
1c22a1ec0d StyleCop 2022-08-07 15:24:35 -07:00
Qstick
878d1561aa Build Sonarr on Net6
Co-Authored-By: ta264 <ta264@users.noreply.github.com>
2022-08-07 15:04:46 -07:00
Taloth Saldono
feebb349d5 Linting error. 2019-03-09 00:21:06 +01:00
Taloth Saldono
e8161aa9f4 Added specific external updater messages for Apt and Docker. 2018-12-29 13:51:34 +01:00
Taloth Saldono
206ff12b71 Added .editorconfig 2016-08-13 22:22:24 +02:00