Skip to content

Commit

Permalink
Fix: remove core31 and regex timeout (#299)
Browse files Browse the repository at this point in the history
* Fix: remove core31 and regex timeout falacies

* Fix: codacy workflow

* Fix: upgrade to java17 sonar cloud

* Fix:sonarcloud

* Fix Security code scan

* Fix: securitychecks scna
  • Loading branch information
lduchosal authored Jan 17, 2024
1 parent c23c721 commit fab8751
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 24 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ jobs:
runs-on: windows-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 1.11
distribution: 'temurin'
java-version: 17
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@main

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
uses: codacy/codacy-analysis-cli-action@master
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/securitycodescan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
SCS:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: nuget/setup-nuget@04b0c2b8d1b97922f67eca497d7cf0bf17b8ffe1
- uses: actions/checkout@master
- uses: nuget/setup-nuget@v1
- uses: microsoft/[email protected]

- name: Set up projects for analysis
uses: security-code-scan/security-code-scan-add-action@f8ff4f2763ed6f229eded80b1f9af82ae7f32a0d
uses: security-code-scan/security-code-scan-add-action@main

- name: Restore dependencies
run: dotnet restore src
Expand All @@ -35,7 +35,7 @@ jobs:
run: dotnet build --no-restore src

- name: Convert sarif for uploading to GitHub
uses: security-code-scan/security-code-scan-results-action@cdb3d5e639054395e45bf401cba8688fcaf7a687
uses: security-code-scan/security-code-scan-results-action@main

- name: Upload sarif
uses: github/codeql-action/upload-sarif@v2
2 changes: 1 addition & 1 deletion src/ConsoleApplication/ConsoleApplication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net462;net47;net48;netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net462;net47;net48;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net8.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<SignAssembly>True</SignAssembly>
Expand Down
4 changes: 2 additions & 2 deletions src/System.Net.IPNetwork/IPNetwork2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,8 @@ private static void InternalParse(bool tryParse, string network, ICidrGuess cidr

if (sanitanize)
{
network = Regex.Replace(network, @"[^0-9a-fA-F\.\/\s\:]+", string.Empty);
network = Regex.Replace(network, @"\s{2,}", " ");
network = Regex.Replace(network, @"[^0-9a-fA-F\.\/\s\:]+", string.Empty, RegexOptions.None, TimeSpan.FromMilliseconds(100));
network = Regex.Replace(network, @"\s{2,}", " ", RegexOptions.None, TimeSpan.FromMilliseconds(100));
network = network.Trim();
}

Expand Down
4 changes: 2 additions & 2 deletions src/System.Net.IPNetwork/System.Net.IPNetwork.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net462;net47;net48;netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard2.0;netstandard2.1;netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net462;net47;net48;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageId>IPNetwork2</PackageId>
<PackageVersion>3.0.0</PackageVersion>
Expand Down
12 changes: 1 addition & 11 deletions src/TestProject/TestProject.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;net47;net48;netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net462;net47;net48;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net8.0</TargetFrameworks>


<IsPackable>false</IsPackable>


<SignAssembly>True</SignAssembly>
<SignAssembly Condition="'$(OS)' != 'Windows_NT'">false</SignAssembly>

Expand All @@ -32,14 +30,6 @@
<DefineConstants>$(DefineConstants)TRACE;TRAVISCI</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp3.1|AnyCPU'">
<DefineConstants>$(DefineConstants)TRACE;TRAVISCI</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netcoreapp3.1|AnyCPU'">
<DefineConstants>$(DefineConstants)TRACE;TRAVISCI</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0|AnyCPU'">
<DefineConstants>$(DefineConstants)TRACE;TRAVISCI</DefineConstants>
</PropertyGroup>
Expand Down

0 comments on commit fab8751

Please sign in to comment.