Fix code compliance check failures
- Dominant language
- C#
- Stars
- 30
- Forks
- 13
- Avg merge
- 7d 10h
- Merged PRs (30d)
- 5
Description
#### Broken rules:
Multiple files are failing two automated compliance checks:
**MethodNameContainsFileName** - method name must start or end with the name of its containing file:
https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/MethodNameContainsFileName
| File | Line | Non-compliant Method Name |
|---|---|---|
| Analytical_Engine/Query/ExternalPolycurve.cs | 47 | `ExternalPolyCurve` |
| BHoM_Engine/Compute/SuppressRecording.cs | 41 | `StartSuppressRecordingEvents` |
| BHoM_Engine/Compute/SuppressRecording.cs | 57 | `StopSuppressRecordingEvents` |
| BHoM_Engine/Modify/SplitAndRemoveAtIndexes.cs | 40 | `RemoveAndSplitAtIndexes` |
| Data_Engine/Query/FurthestSquareDistance.cs | 58 | `FurthestTightSquareDistance` |
| Environment_Engine/Compute/MapToLevel.cs | 120 | `MaptoLevel` |
| Environment_Engine/Modify/ReplaceSpaceName.cs | 41 | `ReplaceConnectedSpaceName` |
| Graphics_Engine/Modify/RepresentationFragments/Boxes.cs | 52 | `RepresentationFragment` |
| Graphics_Engine/Modify/View/DependencyChart.cs | 49 | `DependencyChartView` |
| Search_Engine/Compute/Ratios/FuzzyMatch.cs | 50 | `MatchScore` |
**ModifyReturnsDifferentType** - Modify methods must return void or a type different
from the input type of their first parameter:
https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/ModifyReturnsDifferentType
| File | Line | Issue |
|---|---|---|
| Environment_Engine/Modify/ReplaceSpaceName.cs | 41 | Returns `List`, first parameter is also `List` |
#### Suggestions to restore compliance:
- **ExternalPolycurve.cs**: Rename `ExternalPolyCurve` > `ExternalPolycurve` to match file name casing exactly
- **SuppressRecording.cs**: Rename `StartSuppressRecordingEvents` > `StartSuppressRecording` and `StopSuppressRecordingEvents` > `StopSuppressRecording`
- **SplitAndRemoveAtIndexes.cs**: Rename `RemoveAndSplitAtIndexes` > `SplitAndRemoveAtIndexes`
- **FurthestSquareDistance.cs**: Rename `FurthestTightSquareDistance` > `FurthestSquareDistance` and update the internal caller in `Data_Engine/Query/ClosestData.cs`
- **MapToLevel.cs**: Rename `MaptoLevel` > `MapToLevel`
- **ReplaceSpaceName.cs**: Rename `ReplaceConnectedSpaceName` > `ReplaceSpaceName` and change the first parameter from `List` to `IEnumerable` to satisfy both failing rules simultaneously
- **Boxes.cs**: Change `RepresentationFragment` from `public` to `private`, consistent with the identical dispatch pattern already used in `Links.cs`. UI access is unaffected as it routes through the existing public `IRepresentationFragment` dispatcher
- **DependencyChart.cs**: Rename `DependencyChartView` > `DependencyChart`
- **FuzzyMatch.cs**: Rename `MatchScore` > `FuzzyMatch`
Contributor guide
Assessment
This issue has not been assessed yet.