Anapher/Strive

View on GitHub

Showing 250 of 735 total issues

Function leave has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

   async leave(participant: Participant): Promise<void> {
      logger.info('leave() | participantId: %s | roomId: %s', participant.participantId, this.id);

      const status = this.participantStatus.get(participant.participantId);
      if (status) {
Severity: Minor
Found in src/Services/SFU/src/lib/rooms/room.ts - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method AssertSyncObject has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

            await connection.SyncObjects.AssertSyncObject<SynchronizedSubscriptions>(subscriptionsId,
                x => Assert.Contains(x.Subscriptions.Keys, id => id == testRoomChannel));

    Method Whiteboard has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public record Whiteboard (string Id, string FriendlyName, bool AnyoneCanEdit, WhiteboardCanvas Canvas,
            IImmutableDictionary<string, ParticipantWhiteboardState> ParticipantStates, int Version);

      Method OpenBreakoutRoomsRequest has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public record OpenBreakoutRoomsRequest(int Amount, DateTimeOffset? Deadline, string? Description,
              string[][]? AssignedRooms, string ConferenceId) : BreakoutRoomsConfig(Amount, Deadline, Description),

        Method ChatMessageDto has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public record ChatMessageDto(int Id, string Channel, ChatMessageSender? Sender, string Message,
                DateTimeOffset Timestamp, ChatMessageOptions Options);

          Method SynchronizedConferenceInfo has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public record SynchronizedConferenceInfo(bool IsOpen, IImmutableList<string> Moderators,
                  DateTimeOffset? ScheduledDate, string? Name, bool IsPrivateChatEnabled, SceneOptions SceneOptions)

            Method DrawingLineCanvasLiveAction has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public record DrawingLineCanvasLiveAction (string Color, double StrokeWidth, double StartX, double StartY,
                    double EndX, double EndY) : CanvasLiveAction;

              Consider simplifying this complex logical expression.
              Open

                 if (!left || !top || !groupLeft || !groupTop || !groupWidth || !groupHeight)
                    return { left: undefined, top: undefined };
              Severity: Major
              Found in src/Web/WebSPA/Client/src/features/whiteboard/fabric-utils.ts - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                      if (!left || !top || !groupLeft || !groupTop || !groupWidth || !groupHeight) return;
                Severity: Major
                Found in src/Web/WebSPA/Client/src/features/whiteboard/fabric-utils.ts - About 40 mins to fix

                  Function wrapControl has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                     source: ProducerSource,
                     device: AnyInputDevice | undefined,
                     local: UseMediaState,
                     equipment: Record<string, EquipmentConnection> | undefined,
                     dispatch: Dispatch<any>,
                  Severity: Minor
                  Found in src/Web/WebSPA/Client/src/features/media/useDeviceManagement.ts - About 35 mins to fix

                    Function conferenceFactory has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                       id: string,
                       workers: MediaSoupWorkers,
                       repository: ConferenceRepository,
                       rabbit: RabbitMqConn,
                       { routerOptions, webrtcOptions, maxIncomingBitrate }: ConferenceManagerOptions,
                    Severity: Minor
                    Found in src/Services/SFU/src/lib/conference/conference-factory.ts - About 35 mins to fix

                      Method SynchronizedPoll has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public record SynchronizedPoll(string Id, PollInstruction Instruction, PollConfig Config, PollState State,
                              DateTimeOffset CreatedOn)

                        Method IsUpdateRequired has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                ValueTask<SceneUpdate> IsUpdateRequired(string conferenceId, string roomId, string syncObjId,
                                    object synchronizedObject, object? previousValue);

                          Method InternalIsUpdateRequired has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  protected abstract ValueTask<bool> InternalIsUpdateRequired(string conferenceId, string roomId,
                                      string syncObjId, object synchronizedObject, object? previousValue);

                            Method ReadJson has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    public override Error? ReadJson(JsonReader reader, Type objectType, Error? existingValue, bool hasExistingValue,
                                        JsonSerializer serializer)

                              Method RoomRepository_SetParticipantRoom has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      private static async ValueTask<RedisResult> RoomRepository_SetParticipantRoom(IKeyValueDatabaseActions actions,
                                          string roomMappingKey, string roomListKey, string participantId, string newRoomId)

                                Method JoinedParticipantsRepository_RemoveParticipantSafe has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                            IKeyValueDatabaseActions actions, string participantId, string participantKey, string conferenceKeyTemplate,
                                            string connectionId)

                                  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 CreatePollRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        public record CreatePollRequest(string ConferenceId, PollInstruction Instruction, PollConfig Config,
                                            PollState InitialState, string? RoomId) : IRequest<string>;

                                      Method SendEquipmentCommandNotification has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          public record SendEquipmentCommandNotification(Participant Participant, string ConnectionId, ProducerSource Source,
                                              string? DeviceId, EquipmentCommandType Action) : INotification;
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language