Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Sonarcloud issues / Suppress non issues #1533

Merged
merged 3 commits into from
Apr 4, 2024
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
2 changes: 1 addition & 1 deletion pipelines/azure/develop-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ stages:
jobs:
- job: buildnetcore
displayName: 'Build'
timeoutInMinutes: 25 # how long to run the job before automatically cancelling
timeoutInMinutes: 30 # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: 10 # how much time to give 'run always even if cancelled tasks' before stopping them
pool:
vmImage: 'ubuntu-22.04'
Expand Down
3 changes: 3 additions & 0 deletions starsky/build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ namespace build;
[SuppressMessage("Sonar",
"S2629: Don't use string interpolation in logging message templates",
Justification = "Not production code.")]
[SuppressMessage("Sonar",
"S6664: Reduce the number of Information logging calls within this code block",
Justification = "Not production code.")]
[ShutdownDotNetAfterServerBuild]
public sealed class Build : NukeBuild
{
Expand Down
4 changes: 4 additions & 0 deletions starsky/build/helpers/DotnetGenericHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using build;
using Nuke.Common.ProjectModel;
Expand All @@ -9,6 +10,9 @@

namespace helpers
{
[SuppressMessage("Sonar",
"S6664: Reduce the number of Information logging calls within this code block",
Justification = "Not production code.")]
public static class DotnetGenericHelper
{
/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions starsky/build/helpers/DotnetTestHelper.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using System.IO;
using build;
using Nuke.Common.IO;
Expand All @@ -9,6 +10,9 @@

namespace helpers
{
[SuppressMessage("Sonar",
"S6664: Reduce the number of Information logging calls within this code block",
Justification = "Not production code.")]
public static class DotnetTestHelper
{
static bool DirectoryExists(string path)
Expand Down
3 changes: 3 additions & 0 deletions starsky/build/helpers/SonarQube.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ namespace helpers
[SuppressMessage("Sonar",
"S2629: Don't use string interpolation in logging message templates",
Justification = "Not production code.")]
[SuppressMessage("Sonar",
"S6664: Reduce the number of Information logging calls within this code block",
Justification = "Not production code.")]
public static class SonarQube
{
public const string SonarQubePackageName = "dotnet-sonarscanner";
Expand Down
3 changes: 3 additions & 0 deletions starsky/build/helpers/TrxParserHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

namespace helpers;

[SuppressMessage("Sonar",
"S6664: Reduce the number of Information logging calls within this code block",
Justification = "Not production code.")]
public static class TrxParserHelper
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.Diagnostics.CodeAnalysis;

// GlobalSuppressions.cs

// S1309: Do not suppress issues.
[assembly:
SuppressMessage("Sonar", "S1309",
Expand Down
12 changes: 12 additions & 0 deletions starsky/starsky/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Diagnostics.CodeAnalysis;

// GlobalSuppressions.cs

// S6931:Change the paths of the actions of this controller to be relative
// and add a controller route with the common prefix.
[assembly:
SuppressMessage("Sonar", "S6931",
Justification =
"Change the paths of the actions of this controller to be relative and " +
"add a controller route with the common prefix.",
Scope = "module")]
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class UpdateRelativeObject {
setRelativeObjects(result.data);
resolve(result.data);
})
.catch((err) => {
.catch((err: Error) => {
console.error(err);
rejects(err);
});
Expand Down