Anapher/Strive

View on GitHub

Showing 735 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));

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            [Fact]
            public void Validate_SelectedInvalidOption_ReturnError()
            {
                // act
                var result = _validator.Validate(new MultipleChoiceInstruction(new[] {"A", "B", "C"}, null),
    src/Services/ConferenceManagement/Strive.Core.Tests/Services/Poll/Types/MultipleChoice/MultipleChoiceAnswerValidatorTests.cs on lines 55..64

    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 75.

    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

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            [Fact]
            public void Validate_ExactlyAsManyAsAllowed_ReturnNull()
            {
                // act
                var result = _validator.Validate(new MultipleChoiceInstruction(new[] {"A", "B", "C"}, 2),
    src/Services/ConferenceManagement/Strive.Core.Tests/Services/Poll/Types/MultipleChoice/MultipleChoiceAnswerValidatorTests.cs on lines 22..31

    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 75.

    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

    Further Reading

    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;

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                    [openDialogToPatchAsync.rejected.type]: (state, action: PayloadAction<void, string, never, DomainError>) => {
                       state.loadingConferenceDataError = action.error;
                    },
              Severity: Minor
              Found in src/Web/WebSPA/Client/src/features/create-conference/reducer.ts and 1 other location - About 45 mins to fix
              src/Web/WebSPA/Client/src/features/create-conference/reducer.ts on lines 119..121

              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 50.

              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

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                 chips: {
                    marginTop: theme.spacing(1),
                    marginBottom: theme.spacing(1),
                    paddingRight: theme.spacing(2),
                    height: 24,
              src/Web/WebSPA/Client/src/features/create-conference/components/CreateConferenceFormSkeleton.tsx on lines 6..11
              src/Web/WebSPA/Client/src/features/scenes/components/activeSpeaker/RenderActiveSpeaker.tsx on lines 23..28

              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 50.

              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

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                          var result = await conn.Hub.InvokeAsync<SuccessOrError<Unit>>(nameof(CoreHub.WhiteboardPushAction),
                              new WhiteboardPushActionDto(whiteboardId, new UpdateCanvasPushAction(canvasPatch.Yield().ToList())));
              src/Services/ConferenceManagement/Strive.IntegrationTests/Services/WhiteboardTests.cs on lines 280..281

              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 75.

              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

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                          var result = await conn.Hub.InvokeAsync<SuccessOrError<Unit>>(nameof(CoreHub.WhiteboardPushAction),
                              new WhiteboardPushActionDto(whiteboardId, new DeleteCanvasPushAction(objId.Yield().ToList())));
              src/Services/ConferenceManagement/Strive.IntegrationTests/Services/WhiteboardTests.cs on lines 255..256

              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 75.

              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

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                    [openDialogToCreateAsync.rejected.type]: (state, action: PayloadAction<void, string, never, DomainError>) => {
                       state.loadingConferenceDataError = action.error;
                    },
              Severity: Minor
              Found in src/Web/WebSPA/Client/src/features/create-conference/reducer.ts and 1 other location - About 45 mins to fix
              src/Web/WebSPA/Client/src/features/create-conference/reducer.ts on lines 138..140

              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 50.

              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

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                 controlSkeleton: {
                    marginTop: theme.spacing(2),
                    marginLeft: theme.spacing(2),
                    marginRight: theme.spacing(2),
                    height: 32,
              src/Web/WebSPA/Client/src/features/scenes/components/ActiveChipsLayout.tsx on lines 13..18
              src/Web/WebSPA/Client/src/features/scenes/components/activeSpeaker/RenderActiveSpeaker.tsx on lines 23..28

              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 50.

              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

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                 chips: {
                    marginTop: theme.spacing(1),
                    marginBottom: theme.spacing(1),
                    paddingRight: theme.spacing(2),
                    height: 24,
              src/Web/WebSPA/Client/src/features/create-conference/components/CreateConferenceFormSkeleton.tsx on lines 6..11
              src/Web/WebSPA/Client/src/features/scenes/components/ActiveChipsLayout.tsx on lines 13..18

              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 50.

              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

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                       this.connection.changeStream({ id: consumer.id, type: 'consumer', action: 'resume' }).catch(() => {
                          // ignore
                       });
              src/Web/WebSPA/Client/src/store/webrtc/consumer-usage-control.ts on lines 102..104

              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 50.

              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

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                       this.connection.changeStream({ id: consumer.id, type: 'consumer', action: 'pause' }).catch(() => {
                          // ignore
                       });
              src/Web/WebSPA/Client/src/store/webrtc/consumer-usage-control.ts on lines 55..57

              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 50.

              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

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      [Theory]
                      [MemberData(nameof(TestData))]
                      public void TestGetName(int index, string expected)
                      {
                          var name = new NatoRoomNamingStrategy().GetName(index);
              src/Services/ConferenceManagement/Strive.Core.Tests/Services/BreakoutRooms/Naming/NatoRoomNamingStrategyTest.cs on lines 25..31

              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 74.

              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

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      [Theory]
                      [MemberData(nameof(TestData))]
                      public void TestParseIndex(int expected, string name)
                      {
                          var index = new NatoRoomNamingStrategy().ParseIndex(name);
              src/Services/ConferenceManagement/Strive.Core.Tests/Services/BreakoutRooms/Naming/NatoRoomNamingStrategyTest.cs on lines 17..23

              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 74.

              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

              Further Reading

              Severity
              Category
              Status
              Source
              Language