Anapher/Strive

View on GitHub

Showing 735 of 735 total issues

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

using System.Threading;
using System.Threading.Tasks;
using MediatR;
using Strive.Core.Extensions;
using Strive.Core.Services.WhiteboardService.Requests;
src/Services/ConferenceManagement/Strive.Core/Services/WhiteboardService/UseCases/RedoUseCase.cs on lines 1..59

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

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

using System.Threading;
using System.Threading.Tasks;
using MediatR;
using Strive.Core.Extensions;
using Strive.Core.Services.WhiteboardService.Requests;
src/Services/ConferenceManagement/Strive.Core/Services/WhiteboardService/UseCases/UndoUseCase.cs on lines 1..59

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

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

                     <Grid item lg={4}>
                        {Array.from({ length: createdRooms }).map(
                           (_, i) =>
                              i % 2 === 0 && (
                                 <RoomList
src/Web/WebSPA/Client/src/features/breakout-rooms/components/BreakoutRoomsAssignments.tsx on lines 170..182

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

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

                     <Grid item lg={4}>
                        {Array.from({ length: createdRooms }).map(
                           (_, i) =>
                              i % 2 === 1 && (
                                 <RoomList
src/Web/WebSPA/Client/src/features/breakout-rooms/components/BreakoutRoomsAssignments.tsx on lines 157..169

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

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

Function configureEndpoints has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function configureEndpoints(app: Express, conferenceManager: ConferenceManager): void {
   app.use(express.json());
   app.use(jwt({ algorithms: ['HS256'], secret: config.services.tokenSecret }));
   app.use(cors());

Severity: Major
Found in src/Services/SFU/src/controllers.ts - About 4 hrs to fix

    Function useMedia has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function useMedia(
       source: ProducerSource,
       getMediaTrack: (deviceId?: string) => Promise<MediaStreamTrack>,
       options?: Partial<ProducerOptions> | ((track: MediaStreamTrack) => Partial<ProducerOptions>),
    ): UseMediaState {
    Severity: Minor
    Found in src/Web/WebSPA/Client/src/store/webrtc/hooks/useMedia.ts - About 4 hrs 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

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

                      <FormControlLabel
                         className={classes.checkBoxLabel}
                         control={
                            <Controller
                               render={({ field: { onChange, value } }) => (
    src/Web/WebSPA/Client/src/features/create-conference/components/TabCommon.tsx on lines 92..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 118.

    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

                   <FormControlLabel
                      className={classes.checkBoxLabel}
                      control={
                         <Controller
                            render={({ field: { onChange, value } }) => (
    src/Web/WebSPA/Client/src/features/create-conference/components/TabCommon.tsx on lines 122..134

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

    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

    File ApplyBreakoutRoomUseCaseTests.cs has 335 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading;
    using System.Threading.Tasks;

      Function DiagnosticsView has 99 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function DiagnosticsView() {
         const participantsOfRoom = useSelector(selectParticipantsOfCurrentRoom);
         const participants = useSelector(selectParticipantList);
         const participantMap = useSelector(selectParticipants);
      
      

        Function MediaFab has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function MediaFab({
           Icon,
           pauseOnToggle,
           control: { enable, disable, pause, resume, enabled, paused },
           translationKey,
        Severity: Minor
        Found in src/Web/WebSPA/Client/src/features/media/components/MediaFab.tsx - About 3 hrs 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

        Function useMedia has 97 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function useMedia(
           source: ProducerSource,
           getMediaTrack: (deviceId?: string) => Promise<MediaStreamTrack>,
           options?: Partial<ProducerOptions> | ((track: MediaStreamTrack) => Partial<ProducerOptions>),
        ): UseMediaState {
        Severity: Major
        Found in src/Web/WebSPA/Client/src/store/webrtc/hooks/useMedia.ts - About 3 hrs to fix

          Function middleware has 96 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const middleware: Middleware = () => {
             const activeToasts = new Map<string, ActiveToast[]>();
          
             const addToastHandler = (info: ActiveToast) => {
                const list = activeToasts.get(info.actionType) ?? [];
          Severity: Major
          Found in src/Web/WebSPA/Client/src/store/notifier/create-middleware.ts - About 3 hrs to fix

            Function Equipment has 96 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function Equipment() {
               const dispatch = useDispatch();
               const classes = useStyles();
               const executingCommands = useRef(new Set<number>());
            
            
            Severity: Major
            Found in src/Web/WebSPA/Client/src/features/equipment/components/Equipment.tsx - About 3 hrs to fix

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

              test.each`
                 expected                           | syncId
                 ${'test'}                          | ${{ id: 'test', parameters: {} }}
                 ${'hello_world'}                   | ${{ id: 'hello_world', parameters: {} }}
                 ${'hello_world?participantId=123'} | ${{ id: 'hello_world', parameters: { participantId: '123' } }}
              src/Web/WebSPA/Client/src/store/signal/synchronization/synchronized-object-id.test.ts on lines 3..13

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

              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

              test.each`
                 s                                  | expected
                 ${'test'}                          | ${{ id: 'test', parameters: {} }}
                 ${'hello_world'}                   | ${{ id: 'hello_world', parameters: {} }}
                 ${'hello_world?participantId=123'} | ${{ id: 'hello_world', parameters: { participantId: '123' } }}
              src/Web/WebSPA/Client/src/store/signal/synchronization/synchronized-object-id.test.ts on lines 15..24

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

              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

              File SceneTests.cs has 322 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              using System.Collections.Generic;
              using System.Linq;
              using System.Threading.Tasks;
              using MediatR;
              using Microsoft.AspNetCore.SignalR.Client;

                File WhiteboardTests.cs has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                using System.Collections.Generic;
                using System.Linq;
                using System.Threading.Tasks;
                using MediatR;
                using Microsoft.AspNetCore.JsonPatch;

                  File TabCommon.tsx has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import {
                     Box,
                     Checkbox,
                     Collapse,
                     FormControl,

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

                                   <FormControlLabel
                                      control={
                                         <Controller
                                            render={({ field: { onChange, value } }) => (
                                               <Checkbox onChange={(e) => onChange(e.target.checked)} checked={value} />
                    src/Web/WebSPA/Client/src/features/create-conference/components/TabCommon.tsx on lines 190..201
                    src/Web/WebSPA/Client/src/features/create-conference/components/TabCommon.tsx on lines 202..213
                    src/Web/WebSPA/Client/src/features/create-conference/components/TabCommon.tsx on lines 215..226
                    src/Web/WebSPA/Client/src/features/create-conference/components/TabCommon.tsx on lines 227..238
                    src/Web/WebSPA/Client/src/features/create-conference/components/TabCommon.tsx on lines 312..323

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

                    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