Skip to content
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/analyzer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
9.x

- name: Build Solution
run: dotnet build test-app | tee build.log # Output to both build.log and stdout, required for `Extract warning` step
run: dotnet build ./test-app/test-app.sln > build.log # Output to both build.log and stdout, required for `Extract warning` step

- name: Extract warning
uses: actions/github-script@v7
Expand All @@ -41,7 +41,7 @@ jobs:
const rulePatterns = {
Warning: { ids: ['FAWRN\\d+'], type: 'Warning' },
Information: { ids: ['FAINF\\d+'], type: 'Information' },
Error: { ids: [], type: 'Error' }
Error: { ids: ['-'], type: 'Error' }
};
// Example match: `MyFile.cs(12,4): warning AB1234: 'Foo' is obsolete (http://example.com)`
const patterns = Object.values(rulePatterns).map(({ ids, type }) => ({
Expand Down Expand Up @@ -145,4 +145,4 @@ jobs:
}
});
}
console.log(mdComment);
console.log(mdComment);
2 changes: 1 addition & 1 deletion test-app/test-app/TestCodeAnalyzer/RawSql.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

public void Execute()
{
_context.Set<Entity>().FromSqlRaw("SELECT * FROM Entity"); // Should have warning
_context.Set<Entity>().FromSqlRaw("SELECT * FROM Entity"); // Should have warning

Check notice on line 30 in test-app/test-app/TestCodeAnalyzer/RawSql.cs

View workflow job for this annotation

GitHub Actions / Code Analyzer Check

FAINF0002 in test-app/test-app/TestCodeAnalyzer/RawSql.cs

'FromSqlRaw' should only be used within classes implementing IDataHandler to prevent SQL injection risks. More info: https://flowaccount.atlassian.net/wiki/spaces/fa/pages/142278772/Rules#FAINF0002
}

}
Expand Down
2 changes: 1 addition & 1 deletion test-app/test-app/TestCodeAnalyzer/RequiredProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
private readonly IDataHandler<Model> _mockDataHandler = new DataHandler<Model>();
public void SampleMethod()
{
_mockDataHandler.FindList(m => m.Name == "Test"); // Should warning
_mockDataHandler.FindList(m => m.Name == "Test"); // Should warning

Check warning on line 38 in test-app/test-app/TestCodeAnalyzer/RequiredProperties.cs

View workflow job for this annotation

GitHub Actions / Code Analyzer Check

FAWRN0001 in test-app/test-app/TestCodeAnalyzer/RequiredProperties.cs

Query in method 'FindList' does not include the required properties, add at least one required property More info: https://flowaccount.atlassian.net/wiki/spaces/fa/pages/142278772/Rules#FAWRN0001
}
}
}
4 changes: 2 additions & 2 deletions test-app/test-app/TestCodeAnalyzer/TaskBlocking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{
Task task1 = Task.CompletedTask;
Task<int> task2 = Task.FromResult(42);
task1.Wait(); // Should have warning
var result = task2.Result; // Should have warning
task1.Wait(); // Should have warning

Check notice on line 11 in test-app/test-app/TestCodeAnalyzer/TaskBlocking.cs

View workflow job for this annotation

GitHub Actions / Code Analyzer Check

FAINF0001 in test-app/test-app/TestCodeAnalyzer/TaskBlocking.cs

Use 'await' instead of 'Wait' More info: https://flowaccount.atlassian.net/wiki/spaces/fa/pages/142278772/Rules#FAINF0001
var result = task2.Result; // Should have warning

Check notice on line 12 in test-app/test-app/TestCodeAnalyzer/TaskBlocking.cs

View workflow job for this annotation

GitHub Actions / Code Analyzer Check

FAINF0001 in test-app/test-app/TestCodeAnalyzer/TaskBlocking.cs

Use 'await' instead of 'Result' More info: https://flowaccount.atlassian.net/wiki/spaces/fa/pages/142278772/Rules#FAINF0001
}
}
2 changes: 1 addition & 1 deletion test-app/test-app/TestCodeAnalyzer/TaskBlocking2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Task task1 = Task.CompletedTask;
Task<int> task2 = Task.FromResult(42);
task1.Wait(); // Should have warning
var result = task2.Result; // No warning, because i didn't touch
var result = task2.Result; // Should have warning

Check notice on line 12 in test-app/test-app/TestCodeAnalyzer/TaskBlocking2.cs

View workflow job for this annotation

GitHub Actions / Code Analyzer Check

FAINF0001 in test-app/test-app/TestCodeAnalyzer/TaskBlocking2.cs

Use 'await' instead of 'Result' More info: https://flowaccount.atlassian.net/wiki/spaces/fa/pages/142278772/Rules#FAINF0001

}
}
Loading