1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 18:42:56 +08:00

Merge pull request #10649 from ppy/dependabot/nuget/Microsoft.CodeAnalysis.FxCopAnalyzers-3.3.1

This commit is contained in:
Dean Herbert 2020-11-02 11:52:38 +09:00 committed by GitHub
commit 6e2d722b8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 21 additions and 18 deletions

View File

@ -18,7 +18,7 @@
<ItemGroup Label="Code Analysis">
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.1" PrivateAssets="All" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CodeAnalysis\BannedSymbols.txt" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1" PrivateAssets="All" />
</ItemGroup>
<PropertyGroup Label="Code Analysis">
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodeAnalysis\osu.ruleset</CodeAnalysisRuleSet>

View File

@ -64,8 +64,8 @@ namespace osu.Game.Rulesets.Osu.Mods
/// </summary>
private const float target_clamp = 1;
private readonly float targetBreakMultiplier = 0;
private readonly float easing = 1;
private readonly float targetBreakMultiplier;
private readonly float easing;
private readonly CompositeDrawable restrictTo;
@ -86,6 +86,9 @@ namespace osu.Game.Rulesets.Osu.Mods
{
this.restrictTo = restrictTo;
this.beatmap = beatmap;
targetBreakMultiplier = 0;
easing = 1;
}
[BackgroundDependencyLoader]

View File

@ -81,8 +81,8 @@ namespace osu.Game.Tests.Gameplay
private class TestHitObjectWithCombo : ConvertHitObject, IHasComboInformation
{
public bool NewCombo { get; set; } = false;
public int ComboOffset { get; } = 0;
public bool NewCombo { get; set; }
public int ComboOffset => 0;
public Bindable<int> IndexInCurrentComboBindable { get; } = new Bindable<int>();

View File

@ -135,7 +135,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
public Bindable<bool> InitialRoomsReceived { get; } = new Bindable<bool>(true);
public IBindableList<Room> Rooms { get; } = null;
public IBindableList<Room> Rooms => null;
public void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)
{

View File

@ -197,8 +197,8 @@ namespace osu.Game.Tests.Visual.SongSelect
private class TestHitObject : ConvertHitObject, IHasPosition
{
public float X { get; } = 0;
public float Y { get; } = 0;
public float X => 0;
public float Y => 0;
public Vector2 Position { get; } = Vector2.Zero;
}
}

View File

@ -417,7 +417,7 @@ namespace osu.Game.Beatmaps.Formats
string sampleFilename = samples.FirstOrDefault(s => string.IsNullOrEmpty(s.Name))?.LookupNames.First() ?? string.Empty;
int volume = samples.FirstOrDefault()?.Volume ?? 100;
sb.Append(":");
sb.Append(':');
sb.Append(FormattableString.Invariant($"{customSampleBank}:"));
sb.Append(FormattableString.Invariant($"{volume}:"));
sb.Append(FormattableString.Invariant($"{sampleFilename}"));

View File

@ -347,7 +347,7 @@ namespace osu.Game.Beatmaps.Formats
/// <param name="line">The line which may contains variables.</param>
private void decodeVariables(ref string line)
{
while (line.IndexOf('$') >= 0)
while (line.Contains('$'))
{
string origLine = line;

View File

@ -26,7 +26,7 @@ namespace osu.Game.Database
/// Whether this write usage will commit a transaction on completion.
/// If false, there is a parent usage responsible for transaction commit.
/// </summary>
public bool IsTransactionLeader = false;
public bool IsTransactionLeader;
protected void Dispose(bool disposing)
{

View File

@ -21,7 +21,7 @@ namespace osu.Game.Graphics.Containers
/// Allows controlling the scroll bar from any position in the container using the right mouse button.
/// Uses the value of <see cref="DistanceDecayOnRightMouseScrollbar"/> to smoothly scroll to the dragged location.
/// </summary>
public bool RightMouseScrollbar = false;
public bool RightMouseScrollbar;
/// <summary>
/// Controls the rate with which the target position is approached when performing a relative drag. Default is 0.02.

View File

@ -41,7 +41,7 @@ namespace osu.Game.IO.Archives
return null;
byte[] buffer = new byte[input.Length];
await input.ReadAsync(buffer, 0, buffer.Length);
await input.ReadAsync(buffer);
return buffer;
}
}

View File

@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Replays
/// When set, we will ensure frames executed by nested drawables are frame-accurate to replay data.
/// Disabling this can make replay playback smoother (useful for autoplay, currently).
/// </summary>
public bool FrameAccuratePlayback = false;
public bool FrameAccuratePlayback;
protected bool HasFrames => Frames.Count > 0;

View File

@ -84,7 +84,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
matchingFilter &= r.Room.Playlist.Count == 0 || r.Room.Playlist.Any(i => i.Ruleset.Value.Equals(criteria.Ruleset));
if (!string.IsNullOrEmpty(criteria.SearchString))
matchingFilter &= r.FilterTerms.Any(term => term.IndexOf(criteria.SearchString, StringComparison.InvariantCultureIgnoreCase) >= 0);
matchingFilter &= r.FilterTerms.Any(term => term.Contains(criteria.SearchString, StringComparison.InvariantCultureIgnoreCase));
r.MatchingFilter = matchingFilter;
}

View File

@ -59,7 +59,7 @@ namespace osu.Game.Screens.Select.Carousel
var terms = Beatmap.SearchableTerms;
foreach (var criteriaTerm in criteria.SearchTerms)
match &= terms.Any(term => term.IndexOf(criteriaTerm, StringComparison.InvariantCultureIgnoreCase) >= 0);
match &= terms.Any(term => term.Contains(criteriaTerm, StringComparison.InvariantCultureIgnoreCase));
// if a match wasn't found via text matching of terms, do a second catch-all check matching against online IDs.
// this should be done after text matching so we can prioritise matching numbers in metadata.

View File

@ -126,7 +126,7 @@ namespace osu.Game.Screens.Select
if (string.IsNullOrEmpty(value))
return false;
return value.IndexOf(SearchTerm, StringComparison.InvariantCultureIgnoreCase) >= 0;
return value.Contains(SearchTerm, StringComparison.InvariantCultureIgnoreCase);
}
public string SearchTerm;

View File

@ -18,7 +18,7 @@ namespace osu.Game.Tests.Visual
/// <summary>
/// Whether custom test steps are provided. Custom tests should invoke <see cref="CreateTest"/> to create the test steps.
/// </summary>
protected virtual bool HasCustomSteps { get; } = false;
protected virtual bool HasCustomSteps => false;
protected TestPlayer Player;