Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bf78b74
Lab-1. Changed project and organization keys in sonarcloud.yml.
KonstantinDanger Apr 30, 2026
5a148d9
Lab-1. Modified .yaml file.
KonstantinDanger Apr 30, 2026
7a588e1
Merge pull request #1 from KonstantinDanger/lab-1
KonstantinDanger May 1, 2026
fc2bcdf
Added build config
KonstantinDanger May 1, 2026
6e4ae91
Modified config
KonstantinDanger May 1, 2026
3a91383
Merge pull request #2 from KonstantinDanger/lab-1
KonstantinDanger May 1, 2026
ea779f6
Update README.md badges
KonstantinDanger May 1, 2026
7cd02eb
Made _cancellationTokenSource readonly
KonstantinDanger May 1, 2026
43acbc8
Declared EchoServer type in corresponding namespace
KonstantinDanger May 1, 2026
a6a123b
Used proper constructor overload of ArgumentOutOfRangeException
KonstantinDanger May 1, 2026
11d0041
Made _tcpClient readonly
KonstantinDanger May 1, 2026
08afc52
Made _udpClient readonly
KonstantinDanger May 1, 2026
6ef295c
Removed empty statement
KonstantinDanger May 1, 2026
0010437
Marked _udpClient_MessageReceived method as static
KonstantinDanger May 1, 2026
27c0d71
Fixed possible null reference return
KonstantinDanger May 1, 2026
699382b
Fixed null literal to non-nullable reference type conversion
KonstantinDanger May 1, 2026
5c82611
Merge pull request #3 from KonstantinDanger/lab-2
KonstantinDanger May 1, 2026
288103f
Added 5 additional unit tests
KonstantinDanger May 2, 2026
82dc7fb
Merge pull request #4 from KonstantinDanger/lab-3
KonstantinDanger May 2, 2026
5c5a0cc
Added more tests to gain bigger coverage percentage
KonstantinDanger May 2, 2026
419a9e6
Merge pull request #5 from KonstantinDanger/lab-3
KonstantinDanger May 2, 2026
b2cdd6c
Removed code duplication
KonstantinDanger May 4, 2026
24ebd4c
Lab 4: Duplications via SonarCloud
KonstantinDanger May 4, 2026
697bb47
Excluded new methods from coverage check
KonstantinDanger May 4, 2026
32ad0d4
Merge pull request #7 from KonstantinDanger/lab-4
KonstantinDanger May 4, 2026
5932553
Added dependencies and corresponding tests. Made tests to fail on pur…
KonstantinDanger May 16, 2026
e0da58b
Removed dependencies to make tests succeed.
KonstantinDanger May 16, 2026
593e728
Removed commented code.
KonstantinDanger May 16, 2026
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
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: SonarQube
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
runs-on: windows-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
with:
java-version: 17
distribution: "zulu" # Alternative distribution options are available.
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarQube Cloud packages
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarQube Cloud scanner
id: cache-sonar-scanner
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ runner.temp }}\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarQube Cloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path ${{ runner.temp }}\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path ${{ runner.temp }}\scanner
- name: Build and analyze
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
${{ runner.temp }}\scanner\dotnet-sonarscanner begin /k:"KonstantinDanger_reengineering-course-fork2" /o:"konstantindanger" /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
dotnet build
${{ runner.temp }}\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
54 changes: 13 additions & 41 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,10 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow helps you trigger a SonarCloud analysis of your code and populates
# GitHub Code Scanning alerts with the vulnerabilities found.
# Free for open source project.

# 1. Login to SonarCloud.io using your GitHub account

# 2. Import your project on SonarCloud
# * Add your GitHub organization first, then add your repository as a new project.
# * Please note that many languages are eligible for automatic analysis,
# which means that the analysis will start automatically without the need to set up GitHub Actions.
# * This behavior can be changed in Administration > Analysis Method.
#
# 3. Follow the SonarCloud in-product tutorial
# * a. Copy/paste the Project Key and the Organization Key into the args parameter below
# (You'll find this information in SonarCloud. Click on "Information" at the bottom left)
#
# * b. Generate a new token and add it to your Github repository's secrets using the name SONAR_TOKEN
# (On SonarCloud, click on your avatar on top-right > My account > Security
# or go directly to https://sonarcloud.io/account/security/)

# Feel free to take a look at our documentation (https://docs.sonarcloud.io/getting-started/github/)
# or reach out to our community forum if you need some help (https://community.sonarsource.com/c/help/sc/9)

name: SonarCloud analysis

on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
branches: [ "master" ]
branches: ["master"]
workflow_dispatch:

permissions:
Expand All @@ -41,23 +13,23 @@ permissions:
jobs:
sonar-check:
name: Sonar Check
runs-on: windows-latest # безпечно для будь-яких .NET проектів
runs-on: windows-latest # безпечно для будь-яких .NET проектів
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }

- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: "8.0.x"

# 1) BEGIN: SonarScanner for .NET
- name: SonarScanner Begin
run: |
dotnet tool install --global dotnet-sonarscanner
echo "$env:USERPROFILE\.dotnet\tools" >> $env:GITHUB_PATH
dotnet sonarscanner begin `
/k:"ppanchen_NetSdrClient" `
/o:"ppanchen" `
/k:"KonstantinDanger_reengineering-course-fork2" `
/o:"konstantindanger" `
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" `
/d:sonar.cs.opencover.reportsPaths="**/coverage.xml" `
/d:sonar.cpd.cs.minimumTokens=40 `
Expand All @@ -70,13 +42,13 @@ jobs:
run: dotnet restore NetSdrClient.sln
- name: Build
run: dotnet build NetSdrClient.sln -c Release --no-restore
#- name: Tests with coverage (OpenCover)
# run: |
# dotnet test NetSdrClientAppTests/NetSdrClientAppTests.csproj -c Release --no-build `
# /p:CollectCoverage=true `
# /p:CoverletOutput=TestResults/coverage.xml `
# /p:CoverletOutputFormat=opencover
# shell: pwsh
- name: Tests with coverage (OpenCover)
run: |
dotnet test NetSdrClientAppTests/NetSdrClientAppTests.csproj -c Release --no-build `
/p:CollectCoverage=true `
/p:CoverletOutput=TestResults/coverage.xml `
/p:CoverletOutputFormat=opencover
shell: pwsh
# 3) END: SonarScanner
- name: SonarScanner End
run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
Expand Down
Loading