Anapher/Strive

View on GitHub

Showing 735 of 735 total issues

Class InMemoryDatabaseActions has 24 methods (exceeds 20 allowed). Consider refactoring.
Open

    public abstract class InMemoryDatabaseActions : IKeyValueDatabaseActions
    {
        private readonly Dictionary<string, object> _data;

        protected InMemoryDatabaseActions(Dictionary<string, object> data)

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

                   <ListItem button className={classes.nested} onClick={handleSetScene('race')}>
                      <ListItemIcon>
                         <RunFast />
                      </ListItemIcon>
                      <ListItemText
    src/Web/WebSPA/Client/src/features/scenes/components/talkingStick/ModeSceneListItem.tsx on lines 39..47
    src/Web/WebSPA/Client/src/features/scenes/components/talkingStick/ModeSceneListItem.tsx on lines 57..65
    src/Web/WebSPA/Client/src/features/scenes/components/talkingStick/ModeSceneListItem.tsx on lines 66..74

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

    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

       {
          label: t<string>('conference.poll.create_dialog.presets.true_false.label'),
          data: {
             config: { isAnonymous: true, isAnswerFinal: true },
             initialState: { isOpen: true, resultsPublished: false },
    Severity: Major
    Found in src/Web/WebSPA/Client/src/features/poll/poll-presets.ts and 1 other location - About 2 hrs to fix
    src/Web/WebSPA/Client/src/features/poll/poll-presets.ts on lines 10..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 88.

    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 4 locations. Consider refactoring.
    Open

                   <ListItem button className={classes.nested} onClick={handleSetScene('queue')}>
                      <ListItemIcon>
                         <HumanQueue />
                      </ListItemIcon>
                      <ListItemText
    src/Web/WebSPA/Client/src/features/scenes/components/talkingStick/ModeSceneListItem.tsx on lines 48..56
    src/Web/WebSPA/Client/src/features/scenes/components/talkingStick/ModeSceneListItem.tsx on lines 57..65
    src/Web/WebSPA/Client/src/features/scenes/components/talkingStick/ModeSceneListItem.tsx on lines 66..74

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

    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 4 locations. Consider refactoring.
    Open

                   <ListItem button className={classes.nested} onClick={handleSetScene('moderated')}>
                      <ListItemIcon>
                         <AutoFix />
                      </ListItemIcon>
                      <ListItemText
    src/Web/WebSPA/Client/src/features/scenes/components/talkingStick/ModeSceneListItem.tsx on lines 39..47
    src/Web/WebSPA/Client/src/features/scenes/components/talkingStick/ModeSceneListItem.tsx on lines 48..56
    src/Web/WebSPA/Client/src/features/scenes/components/talkingStick/ModeSceneListItem.tsx on lines 66..74

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

    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

       {
          label: t<string>('conference.poll.create_dialog.presets.yes_no.label'),
          data: {
             config: { isAnonymous: true, isAnswerFinal: true },
             initialState: { isOpen: true, resultsPublished: false },
    Severity: Major
    Found in src/Web/WebSPA/Client/src/features/poll/poll-presets.ts and 1 other location - About 2 hrs to fix
    src/Web/WebSPA/Client/src/features/poll/poll-presets.ts on lines 35..48

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

    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 4 locations. Consider refactoring.
    Open

                   <ListItem button className={classes.nested} onClick={handleSetScene('speakerPassStick')}>
                      <ListItemIcon>
                         <AccountArrowRight />
                      </ListItemIcon>
                      <ListItemText
    src/Web/WebSPA/Client/src/features/scenes/components/talkingStick/ModeSceneListItem.tsx on lines 39..47
    src/Web/WebSPA/Client/src/features/scenes/components/talkingStick/ModeSceneListItem.tsx on lines 48..56
    src/Web/WebSPA/Client/src/features/scenes/components/talkingStick/ModeSceneListItem.tsx on lines 57..65

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

    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 SceneTalkingStickTests.cs has 276 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using System.Collections.Generic;
    using System.Threading.Tasks;
    using Autofac;
    using Microsoft.Extensions.Options;

      Class SynchronizationTests has 23 methods (exceeds 20 allowed). Consider refactoring.
      Open

          public class SynchronizationTests : ServiceIntegrationTest
          {
              private const string SyncObjId = "hello";
              private const string ConferenceId = "45";
              private const string ConnectionId = "connectionId";

        Function BreakoutRoomsAssignments has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function BreakoutRoomsAssignments({ data, participants, createdRooms, onChange }: Props) {
           const unassignedParticipants = participants.filter((x) => !data.find((y) => y.includes(x.id)));
           const myParticipantId = useMyParticipantId();
        
           useEffect(() => {

        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 mergeDeep has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        export function mergeDeep(target: any, source: any): any {
           if (isObject(target) && isObject(source)) {
              for (const key in source) {
                 if (isObject(source[key])) {
                    if (!target[key]) {
        Severity: Minor
        Found in src/Web/WebSPA/Client/src/utils/object-merge.ts - About 2 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

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

                public static void AssertScrambledEquals<T>(IEnumerable<T> expected, IEnumerable<T> actual,
                    IEqualityComparer<T> comparer)
                {
                    if (typeof(T).IsAssignableTo(typeof(IComparable)))
                    {
        src/Libs/JsonPatchGenerator.Tests/_Utils/AssertHelper.cs on lines 10..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 175.

        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 synchronizeObjectState has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        export function synchronizeObjectState<TS = any>(
           requests: SynchronizeProperty | SynchronizeProperty[],
           syncObjDeletedCallback?: (state: TS, syncObjId: string) => void,
        ) {
           if (!Array.isArray(requests)) {
        Severity: Minor
        Found in src/Web/WebSPA/Client/src/store/signal/synchronized-object.ts - About 2 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

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

                public static void AssertScrambledEquals<T>(IEnumerable<T> expected, IEnumerable<T> actual,
                    IEqualityComparer<T> comparer)
                {
                    if (typeof(T).IsAssignableTo(typeof(IComparable)))
                    {
        Severity: Major
        Found in src/Libs/JsonPatchGenerator.Tests/_Utils/AssertHelper.cs and 1 other location - About 2 hrs to fix
        src/Services/ConferenceManagement/Strive.Tests.Utils/AssertHelper.cs on lines 17..35

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

        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 CreateConferenceDialog has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function CreateConferenceDialog() {
           const dispatch = useDispatch();
           const theme = useTheme();
           const classes = useStyles();
           const { t } = useTranslation();

          Function SceneView has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function SceneView() {
             const classes = useStyles();
             const [contentRef, dimensions] = useThrottledResizeObserver(100);
          
             const sceneStack = useSelector(selectSceneStack);
          Severity: Major
          Found in src/Web/WebSPA/Client/src/features/scenes/components/SceneView.tsx - About 2 hrs to fix

            Function updateCanvas has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

               public updateCanvas(canvas: WhiteboardCanvas) {
                  canvas = this.pathCache.preprocess(canvas); // paths must be unpacked from point array to svg paths
                  const newVersion = _.maxBy(canvas.objects, (x) => x.version)?.version ?? 0;
            
                  if (!this.currentVersion) {

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

                      public async Task<SuccessOrError<Unit>> WhiteboardLiveAction(WhiteboardLiveActionDto dto)
                      {
                          var participant = GetContextParticipant();
              
                          var result = await GetRoomIdAndCheckIfUserCanModifyWhiteboard(dto.WhiteboardId);
              src/Services/ConferenceManagement/Strive/Hubs/Core/CoreHub.cs on lines 492..506

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

              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

                      public async Task<SuccessOrError<WhiteboardUpdatedResponse>> WhiteboardPushAction(WhiteboardPushActionDto dto)
                      {
                          var participant = GetContextParticipant();
              
                          var roomCheckResult = await GetRoomIdAndCheckIfUserCanModifyWhiteboard(dto.WhiteboardId);
              src/Services/ConferenceManagement/Strive/Hubs/Core/CoreHub.cs on lines 508..522

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

              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 async Task GlobalRedo_NoRedoAvailable_Throw()
                      {
                          // arrange
                          var useCase = Create();
              src/Services/ConferenceManagement/Strive.Core.Tests/Services/WhiteboardService/UseCases/UndoUseCaseTests.cs on lines 51..66

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

              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