Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/qodana_code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ jobs:
fetch-depth: 0 # a full history is required for pull request analysis
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2024.3
with:
pr-mode: false
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_1488465344 }}
QODANA_ENDPOINT: 'https://qodana.cloud'
QODANA_ENDPOINT: 'https://api.qodana.cloud'
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<ItemGroup>
<ProjectReference Include="..\ProjectLighthouse.Localization\ProjectLighthouse.Localization.csproj" />
<ProjectReference Include="..\ProjectLighthouse\ProjectLighthouse.csproj" />
<PackageReference Include="QRCoder" Version="1.5.1" />
<PackageReference Include="QRCoder" Version="1.6.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.18">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
string password = CryptoHelper.Sha256Hash(CryptoHelper.GenerateRandomBytes(64).ToArray());
UserEntity user = await database.CreateUser($"unitTestUser{CryptoHelper.GenerateRandomInt32()}", CryptoHelper.BCryptHash(CryptoHelper.Sha256Hash(password)));

this.Driver.Navigate().GoToUrl(this.BaseAddress + "/login");
// Sometimes not having this causes a race condition
// ReSharper disable once MethodHasAsyncOverload
database.SaveChanges();

await this.Driver.Navigate().GoToUrlAsync(this.BaseAddress + "/login");

this.Driver.FindElement(By.Id("text")).SendKeys(user.Username);
this.Driver.FindElement(By.Id("password")).SendKeys(password);
Expand All @@ -45,7 +49,7 @@

UserEntity user = await database.CreateUser($"unitTestUser{CryptoHelper.GenerateRandomInt32()}", CryptoHelper.BCryptHash("just like the hindenberg,"));

this.Driver.Navigate().GoToUrl(this.BaseAddress + "/login");

Check notice on line 52 in ProjectLighthouse.Tests.WebsiteTests/Integration/AuthenticationTests.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Method has async overload

Method has async overload

this.Driver.FindElement(By.Id("text")).SendKeys(user.Username);

Expand All @@ -66,7 +70,7 @@

UserEntity user = await database.CreateUser($"unitTestUser{CryptoHelper.GenerateRandomInt32()}", CryptoHelper.BCryptHash("i'm an engineering failure"));

this.Driver.Navigate().GoToUrl(this.BaseAddress + "/login");

Check notice on line 73 in ProjectLighthouse.Tests.WebsiteTests/Integration/AuthenticationTests.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Method has async overload

Method has async overload

this.Driver.FindElement(By.Id("text")).SendKeys(user.Username);
this.Driver.FindElement(By.Id("password")).SendKeys("nah man");
Expand Down Expand Up @@ -98,10 +102,10 @@

INavigation navigation = this.Driver.Navigate();

navigation.GoToUrl(this.BaseAddress + "/");

Check notice on line 105 in ProjectLighthouse.Tests.WebsiteTests/Integration/AuthenticationTests.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Method has async overload

Method has async overload
Assert.DoesNotContain(user.Username, this.Driver.FindElement(By.XPath(loggedInAsUsernameTextXPath)).Text);
this.Driver.Manage().Cookies.AddCookie(new Cookie("LighthouseToken", webToken.UserToken));
navigation.Refresh();

Check notice on line 108 in ProjectLighthouse.Tests.WebsiteTests/Integration/AuthenticationTests.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Method has async overload

Method has async overload

Assert.Equal(Translate(LandingPageStrings.LoggedInAs, user.Username), this.Driver.FindElement(By.XPath(loggedInAsUsernameTextXPath)).Text);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.18">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.21.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="125.0.6422.14100" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Selenium.WebDriver" Version="4.34.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="138.0.7204.9400" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
16 changes: 8 additions & 8 deletions ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.18">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.6" />
</ItemGroup>

Expand Down
7 changes: 4 additions & 3 deletions ProjectLighthouse.Tests/Unit/ModerationTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Administration.Maintenance.RepeatingTasks;
using LBPUnion.ProjectLighthouse.Database;
using LBPUnion.ProjectLighthouse.Tests.Helpers;
Expand All @@ -12,7 +13,7 @@ namespace LBPUnion.ProjectLighthouse.Tests.Unit;
public class ModerationTests
{
[Fact]
public async void DismissExpiredCases_ShouldDismissExpiredCase()
public async Task DismissExpiredCases_ShouldDismissExpiredCase()
{
await using DatabaseContext database = await MockHelper.GetTestDatabase();

Expand All @@ -35,7 +36,7 @@ public async void DismissExpiredCases_ShouldDismissExpiredCase()
}

[Fact]
public async void DismissExpiredCases_ShouldNotDismissActiveCase()
public async Task DismissExpiredCases_ShouldNotDismissActiveCase()
{
await using DatabaseContext database = await MockHelper.GetTestDatabase();

Expand All @@ -58,7 +59,7 @@ public async void DismissExpiredCases_ShouldNotDismissActiveCase()
}

[Fact]
public async void DismissExpiredCases_ShouldNotDismissAlreadyDismissedCase()
public async Task DismissExpiredCases_ShouldNotDismissAlreadyDismissedCase()
{
await using DatabaseContext database = await MockHelper.GetTestDatabase();

Expand Down
24 changes: 12 additions & 12 deletions ProjectLighthouse/ProjectLighthouse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@

<ItemGroup>
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
<PackageReference Include="GitInfo" Version="3.3.5">
<PackageReference Include="GitInfo" Version="3.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Pfim" Version="0.11.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
<PackageReference Include="Discord.Net.Webhook" Version="3.15.0" />
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
<PackageReference Include="Pfim" Version="0.11.3" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.10" />
<PackageReference Include="Discord.Net.Webhook" Version="3.17.4" />
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.18">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
<PackageReference Include="Redis.OM" Version="0.7.1" />
<PackageReference Include="Redis.OM" Version="1.0.1" />
<PackageReference Include="SharpZipLib" Version="1.4.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
<PackageReference Include="YamlDotNet" Version="15.1.6" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.3" />
<PackageReference Include="YamlDotNet" Version="16.3.0" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.1" />
<PackageReference Include="DistributedLock.MySql" Version="1.0.2" />
</ItemGroup>

Expand Down
6 changes: 5 additions & 1 deletion qodana.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: "1.0"
linter: jetbrains/qodana-dotnet:2024.1
linter: jetbrains/qodana-dotnet:2024.3
profile:
name: qodana.recommended
include:
Expand All @@ -9,3 +9,7 @@ exclude:
paths:
- ProjectLighthouse.Localization
- ProjectLighthouse/Migrations
- ProjectLighthouse/StaticFiles/css/themes
- ProjectLighthouse/StaticFiles/safari-pinned-tab.svg
dependencyIgnores:
- name: "SixLabors.ImageSharp" # We're open source, so we come under the Apache License
Loading