Showing 735 of 735 total issues
Method OpenBreakoutRoomsDto
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public record OpenBreakoutRoomsDto(int Amount, DateTimeOffset? Deadline, string? Description,
string[][]? AssignedRooms);
Method BuildSceneStack
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private async Task<IReadOnlyList<IScene>> BuildSceneStack(string conferenceId, string roomId,
ActiveScene activeScene, SceneState currentState, IReadOnlyList<IScene> availableScenes)
Method IsUpdateRequired
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public ValueTask<SceneUpdate> IsUpdateRequired(string conferenceId, string roomId, string syncObjId,
object synchronizedObject, object? previousValue)
Method IsUpdateRequired
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public async ValueTask<SceneUpdate> IsUpdateRequired(string conferenceId, string roomId, string syncObjId,
object synchronizedObject, object? previousValue)
Method SendEquipmentCommandRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public record SendEquipmentCommandRequest(Participant Participant, string ConnectionId, ProducerSource Source,
string? DeviceId, EquipmentCommandType Action) : IRequest;
Method FetchSceneProvidersWithRequiredUpdate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string conferenceId, string roomId, string syncObjId, object syncObj, object? previousSyncObj)
Method TestTranslateStartEndIndex
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public void TestTranslateStartEndIndex(int start, int end, int total, int expectedStart, int expectedEnd)
Method InternalIsUpdateRequired
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected override async ValueTask<bool> InternalIsUpdateRequired(string conferenceId, string roomId,
string syncObjId, object synchronizedObject, object? previousValue)
Method InternalIsUpdateRequired
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected override async ValueTask<bool> InternalIsUpdateRequired(string conferenceId, string roomId,
string syncObjId, object synchronizedObject, object? previousValue)
Method SceneBuilderContext
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public record SceneBuilderContext(string ConferenceId, string RoomId, IEnumerable<IScene> AvailableScenes,
SceneOptions Options, IReadOnlyList<IScene> PreviousStack);
Method PushLiveActionRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public record PushLiveActionRequest(string ConferenceId, string RoomId, string ParticipantId, string WhiteboardId,
CanvasLiveAction Action) : IRequest;
Method InternalIsUpdateRequired
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected override ValueTask<bool> InternalIsUpdateRequired(string conferenceId, string roomId,
string syncObjId, object synchronizedObject, object? previousValue)
Method InternalIsUpdateRequired
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected override async ValueTask<bool> InternalIsUpdateRequired(string conferenceId, string roomId,
string syncObjId, object synchronizedObject, object? previousValue)
Method InternalIsUpdateRequired
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected override ValueTask<bool> InternalIsUpdateRequired(string conferenceId, string roomId,
string syncObjId, object synchronizedObject, object? previousValue)
Method IsUpdateRequired
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public async ValueTask<SceneUpdate> IsUpdateRequired(string conferenceId, string roomId, string syncObjId,
object synchronizedObject, object? previousValue)
Method Poll
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public record Poll(string Id, PollInstruction Instruction, PollConfig Config, string? RoomId,
DateTimeOffset CreatedOn);
Method ChatMessageReceivedNotification
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public record ChatMessageReceivedNotification(string ConferenceId, IReadOnlyList<Participant> Participants,
ChatMessage ChatMessage, ChatChannel Channel, int TotalMessagesInChannel) : INotification;
Method PushActionRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public record PushActionRequest (string ConferenceId, string RoomId, string WhiteboardId, string ParticipantId,
CanvasPushAction Action) : IRequest<WhiteboardUpdatedResponse>;
Method SynchronizedWhiteboardInfo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public record SynchronizedWhiteboardInfo(string FriendlyName, bool AnyoneCanEdit, WhiteboardCanvas Canvas,
IReadOnlyDictionary<string, SynchronizedParticipantState> ParticipantStates, int Version);
Similar blocks of code found in 6 locations. Consider refactoring. Open
[Fact]
public void Validate_SelectedDecimalStepDoesNotMatch_ReturnError()
{
// act
var result = _validator.Validate(new NumericInstruction(null, null, 0.5M), new NumericAnswer(0.75M));
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 67.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76