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

Feature 1 #1

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
9 changes: 2 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarQube packages
uses: actions/cache@v1
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache SonarQube scanner
id: cache-sonar-scanner
uses: actions/cache@v1
Expand All @@ -43,4 +38,4 @@ jobs:
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"christophe-havard-sonarsource_Github_Actions_DotNetCore" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}"
dotnet build
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
42 changes: 0 additions & 42 deletions .github/workflows/no-assistance-workflow.yaml

This file was deleted.

32 changes: 27 additions & 5 deletions Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Surfrider {

public static class Helper {
// https://docs.microsoft.com/en-us/azure/key-vault/secrets/quick-create-net

private static string GetKeyVaultConnectionString(string secretName)
{

Expand All @@ -20,14 +20,36 @@ private static string GetKeyVaultConnectionString(string secretName)
}
public static string GetConnectionString()
{
if (Environment.GetEnvironmentVariable("AZURE_FUNCTIONS_ENVIRONMENT") != "Local")
return GetKeyVaultConnectionString("db-plastico-dev-connectionstring");
else

return Environment.GetEnvironmentVariable("postgre_connection");
}
// I add another useless code line
public static void DoNothing(){
Environment.GetEnvironmentVariable("postgre_connection");
int i = 0;
while(i< 100){
// toto
}
}
public static int ComputeWithSomeRecursion(int num, int inc)
{
num = num * ComputeWithSomeRecursion(num, inc-1);
for(int i = 10; i < 10; i++){}
return 2*num;
}
public static void DoNothingAgain(){
// https://rules.sonarsource.com/csharp/type/Bug/RSPEC-3984
int x = -1;
if (x < 0)
{
new ArgumentException("x must be nonnegative");
}

Environment.GetEnvironmentVariable("postgre_connection");
int i = 0;
while(i< 100){
// toto
}
}
}
}
}