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

security system #212

Merged
merged 80 commits into from
Nov 24, 2023

Cleanup of security scanning services (#221)

4102898
Select commit
Loading
Failed to load commit list.
Merged

security system #212

Cleanup of security scanning services (#221)
4102898
Select commit
Loading
Failed to load commit list.
Codacy Production / Codacy Static Code Analysis required action Nov 23, 2023 in 0s

56 new issues (0 max.) of at least minor severity.

Codacy Here is an overview of what got changed by this pull request:

Issues
======
- Added 56
           

Complexity increasing per file
==============================
- UnitystationLauncher/ContentScanning/SandboxError.cs  1
- UnitystationLauncher/ContentScanning/Resolver.cs  9
- UnitystationLauncher/Services/GameCommunicationPipeService.cs  1
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MTypeWackyArray.cs  3
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MMemberRefField.cs  1
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MResScopeType.cs  1
- UnitystationLauncher/Models/ConfigFile/SandboxConfig.cs  1
- UnitystationLauncher/Models/ContentScanning/WhitelistFieldDefine.cs  1
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MMemberRefMethod.cs  1
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MTypeGenericTypePlaceHolder.cs  1
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MResScopeAssembly.cs  1
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MTypePointer.cs  2
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MTypeSZArray.cs  2
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MTypeReferenced.cs  6
- UnitystationLauncher/ContentScanning/AssemblyTypeCheckerHelpers.cs  18
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MTypeDefined.cs  3
- UnitystationLauncher/Models/ContentScanning/MType.cs  1
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MTypePrimitive.cs  20
- UnitystationLauncher/Infrastructure/TypeExtensions.cs  10
- UnitystationLauncher/Models/ContentScanning/WhitelistMethodDefine.cs  1
- UnitystationLauncher/Exceptions/UnsupportedMetadataException.cs  1
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MTypeGeneric.cs  5
- UnitystationLauncher/Models/ContentScanning/TypeConfig.cs  1
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MTypeByRef.cs  2
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MTypeGenericMethodPlaceHolder.cs  1
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MTypeModified.cs  2
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MMemberRef.cs  1
- UnitystationLauncher/ContentScanning/FileInfoComparer.cs  3
- UnitystationLauncher/Services/AssemblyTypeCheckerService.cs  36
- UnitystationLauncher/Services/CodeScanConfigService.cs  7
- UnitystationLauncher/Models/ContentScanning/ScanningTypes/MTypeParsed.cs  8
- UnitystationLauncher/ContentScanning/TypeProvider.cs  1
- UnitystationLauncher/GameCommunicationPipe/PipeHubBuildCommunication.cs  9
- UnitystationLauncher/Services/CodeScanService.cs  20
- UnitystationLauncher/Views/PopUpDialogue.cs  2
         

Clones added
============
- UnitystationLauncher/ContentScanning/Resolver.cs  5
- UnitystationLauncher/ContentScanning/AssemblyTypeCheckerHelpers.cs  2
- UnitystationLauncher/Services/AssemblyTypeCheckerService.cs  4
- UnitystationLauncher/GameCommunicationPipe/PipeHubBuildCommunication.cs  5
         

See the complete overview on Codacy

Annotations

Check warning on line 11 in UnitystationLauncher/ContentScanning/FileInfoComparer.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/ContentScanning/FileInfoComparer.cs#L11

Reformat the code to have only one statement per line.

Check warning on line 5 in UnitystationLauncher/ContentScanning/SandboxError.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/ContentScanning/SandboxError.cs#L5

Types should not have members with visibility set higher than the type's visibility

Check warning on line 10 in UnitystationLauncher/ContentScanning/TypeProvider.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/ContentScanning/TypeProvider.cs#L10

Types should not have members with visibility set higher than the type's visibility

Check failure on line 26 in UnitystationLauncher/GameCommunicationPipe/PipeHubBuildCommunication.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/GameCommunicationPipe/PipeHubBuildCommunication.cs#L26

Add a way to break out of this method's recursion.

Check warning on line 5 in UnitystationLauncher/Models/ContentScanning/ScanningTypes/MMemberRef.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Models/ContentScanning/ScanningTypes/MMemberRef.cs#L5

Make 'ParentType' private.

Check notice on line 16 in UnitystationLauncher/Models/ContentScanning/TypeConfig.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Models/ContentScanning/TypeConfig.cs#L16

Make this field 'private' and encapsulate it in a 'public' property.

Check notice on line 18 in UnitystationLauncher/Models/ContentScanning/TypeConfig.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Models/ContentScanning/TypeConfig.cs#L18

Make this field 'private' and encapsulate it in a 'public' property.

Check warning on line 94 in UnitystationLauncher/Services/AssemblyTypeCheckerService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/AssemblyTypeCheckerService.cs#L94

Merge this if statement with the enclosing one.

Check failure on line 250 in UnitystationLauncher/Services/AssemblyTypeCheckerService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/AssemblyTypeCheckerService.cs#L250

The Cyclomatic Complexity of this method is 36 which is greater than 10 authorized.

Check warning on line 250 in UnitystationLauncher/Services/AssemblyTypeCheckerService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/AssemblyTypeCheckerService.cs#L250

This method 'CheckMemberReferences' has 176 lines, which is greater than the 80 lines authorized. Split it into smaller methods.

Check failure on line 313 in UnitystationLauncher/Services/AssemblyTypeCheckerService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/AssemblyTypeCheckerService.cs#L313

Refactor this code to not nest more than 3 control flow statements.

Check warning on line 323 in UnitystationLauncher/Services/AssemblyTypeCheckerService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/AssemblyTypeCheckerService.cs#L323

Reduce this switch section number of statements from 13 to at most 8, for example by extracting code into a method.

Check failure on line 328 in UnitystationLauncher/Services/AssemblyTypeCheckerService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/AssemblyTypeCheckerService.cs#L328

Refactor this code to not nest more than 3 control flow statements.

Check failure on line 427 in UnitystationLauncher/Services/AssemblyTypeCheckerService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/AssemblyTypeCheckerService.cs#L427

Refactor this code to not nest more than 3 control flow statements.

Check failure on line 455 in UnitystationLauncher/Services/AssemblyTypeCheckerService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/AssemblyTypeCheckerService.cs#L455

Refactor this code to not nest more than 3 control flow statements.

Check failure on line 609 in UnitystationLauncher/Services/AssemblyTypeCheckerService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/AssemblyTypeCheckerService.cs#L609

Refactor this code to not nest more than 3 control flow statements.

Check failure on line 37 in UnitystationLauncher/Services/CodeScanService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/CodeScanService.cs#L37

The Cyclomatic Complexity of this method is 12 which is greater than 10 authorized.

Check warning on line 37 in UnitystationLauncher/Services/CodeScanService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/CodeScanService.cs#L37

This method 'OnScan' has 111 lines, which is greater than the 80 lines authorized. Split it into smaller methods.

Check warning on line 145 in UnitystationLauncher/Services/CodeScanService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/CodeScanService.cs#L145

Reduce this switch section number of statements from 9 to at most 8, for example by extracting code into a method.

Check warning on line 160 in UnitystationLauncher/Services/CodeScanService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/CodeScanService.cs#L160

Reduce this switch section number of statements from 9 to at most 8, for example by extracting code into a method.

Check warning on line 212 in UnitystationLauncher/Services/CodeScanService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/CodeScanService.cs#L212

'System.Exception' should not be thrown by user code.

Check warning on line 233 in UnitystationLauncher/Services/CodeScanService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/CodeScanService.cs#L233

Reformat the code to have only one statement per line.

Check failure on line 423 in UnitystationLauncher/Services/InstallationService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/InstallationService.cs#L423

Change the visibility of 'ErrorList' or make it 'const' or 'readonly'.

Check notice on line 423 in UnitystationLauncher/Services/InstallationService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/InstallationService.cs#L423

Use an immutable collection or reduce the accessibility of the public static field 'ErrorList'.

Check notice on line 456 in UnitystationLauncher/Services/InstallationService.cs

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

UnitystationLauncher/Services/InstallationService.cs#L456

Remove the explicit delegate creation; it is redundant.