Anapher/Strive

View on GitHub

Showing 735 of 735 total issues

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

   isTriggeredBy(id: string): boolean {
      const syncObjId = parseSynchronizedObjectId(id);
      return syncObjId.id === this.descriptor.baseId;
   }
src/Web/WebSPA/Client/src/store/signal/synchronization/synchronized-property.ts on lines 42..45

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

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

      consumer.on('producerpause', () => {
         this.signal.notifyConsumerPaused(connection.connectionId, { consumerId: consumer.id });
      });
Severity: Minor
Found in src/Services/SFU/src/lib/media-soup/mediasoup-mixer.ts and 1 other location - About 35 mins to fix
src/Services/SFU/src/lib/media-soup/mediasoup-mixer.ts on lines 161..163

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

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

            _mediator.Setup(x => x.Send(It.IsAny<TestSuccessOrErrorRequest>(), It.IsAny<CancellationToken>()))
                .ThrowsAsync(new Exception("Test"));
src/Services/ConferenceManagement/Strive.Core.Tests/Services/BreakoutRooms/UseCases/OpenBreakoutRoomsUseCaseTests.cs on lines 61..62

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

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

            <ToggleButton
               value={MEDIA_CAN_SHARE_SCREEN.key}
               aria-label={t('conference.participant_context_menu.allow_screen')}
            >
               <DesktopWindowsIcon fontSize="small" />
src/Web/WebSPA/Client/src/features/conference/components/ParticipantContextMenuTempPermissions.tsx on lines 83..88
src/Web/WebSPA/Client/src/features/conference/components/ParticipantContextMenuTempPermissions.tsx on lines 89..94

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

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

            <ToggleButton
               value={MEDIA_CAN_SHARE_AUDIO.key}
               aria-label={t('conference.participant_context_menu.allow_mic')}
            >
               <MicIcon fontSize="small" />
src/Web/WebSPA/Client/src/features/conference/components/ParticipantContextMenuTempPermissions.tsx on lines 77..82
src/Web/WebSPA/Client/src/features/conference/components/ParticipantContextMenuTempPermissions.tsx on lines 83..88

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

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

const presenter: ScenePresenter<GridScene> = {
   type: 'grid',
   AvailableSceneListItem,
   RenderScene: allowOverwrite(ParticipantsGrid),
   getAutoHideMediaControls: () => true,
src/Web/WebSPA/Client/src/features/scenes/components/activeSpeaker/index.tsx on lines 14..19

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

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

function ActionIcon(source: ProducerSource, action: EquipmentCommandAction) {
   switch (source) {
      case 'mic':
      case 'loopback-mic':
         switch (action) {

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

const middleware: Middleware = () => {
   const activeToasts = new Map<string, ActiveToast[]>();

   const addToastHandler = (info: ActiveToast) => {
      const list = activeToasts.get(info.actionType) ?? [];
Severity: Minor
Found in src/Web/WebSPA/Client/src/store/notifier/create-middleware.ts - About 35 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

Function DetailedStatus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export default function DetailedStatus({ enableError }: Props) {
   const { t } = useTranslation();

   const mics = useSelectorFactory(selectAvailableInputDevicesFactory, (state: RootState, selector) =>
      selector(state, 'mic'),

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

   public async createTransport(
      { sctpCapabilities, forceTcp, producing, consuming }: CreateTransportRequest,
      connectionId: string,
   ): Promise<SuccessOrError<CreateTransportResponse>> {
      const connection = this.connections.get(connectionId);
Severity: Minor
Found in src/Services/SFU/src/lib/conference/conference.ts - About 35 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

Function onObjectRemoved has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

   private onObjectRemoved(e: IEvent) {
      if (!e.target) return;
      const deletionId = (e.target as any).deletionId;

      if (deletionId) {
Severity: Minor
Found in src/Web/WebSPA/Client/src/features/whiteboard/whiteboard-controller.ts - About 35 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

Function PollCard has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export default function PollCard({ poll: viewModel }: Props) {
   const { poll } = viewModel;
   const classes = useStyles();
   const dispatch = useDispatch();
   const { t } = useTranslation();
Severity: Minor
Found in src/Web/WebSPA/Client/src/features/poll/components/PollCard.tsx - About 35 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

Function ChatMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export default function ChatMessage({ message, participantColors }: Props) {
   const classes = useStyles();
   const isEmoji = message && message.message.length <= 8 && onlyEmojisRegex.test(message.message);
   const sender = useSelector((state: RootState) => selectParticipant(state, message?.sender?.participantId));

Severity: Minor
Found in src/Web/WebSPA/Client/src/features/chat/components/ChatMessage.tsx - About 35 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

Function ParticipantContextMenu has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const ParticipantContextMenu = React.forwardRef<HTMLElement, Props>(({ participant, onClose }, _) => {
   const dispatch = useDispatch();
   const classes = useStyles();
   const { t } = useTranslation();

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

export default function ChatMessageList({ messages, participantId, participantColors, error, onRetry }: Props) {
   const classes = useStyles();
   const { t } = useTranslation();

   const listRef = useRef<HTMLOListElement>(null);
Severity: Minor
Found in src/Web/WebSPA/Client/src/features/chat/components/ChatMessageList.tsx - About 35 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

Function validateNumber has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const validateNumber = (n: number | undefined, instruction: NumericInstruction) => {
   if (n === undefined) {
      return { valid: false, error: 'conference.poll.types.numeric.error_invalid_number' };
   }

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

export default function BreakoutRoomsPopper(props: ListItemPopperProps) {
   const dispatch = useDispatch();
   const { t } = useTranslation();
   const classes = useStyles();

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

            var result =
                await olafConnection.Hub.InvokeAsync<SuccessOrError<IReadOnlyList<ChatMessageDto>>>(
                    nameof(CoreHub.FetchChatMessages), new FetchChatMessagesDto(roomChannel, 0, -1));
src/Services/ConferenceManagement/Strive.IntegrationTests/Services/ChatTests.cs on lines 259..261
src/Services/ConferenceManagement/Strive.IntegrationTests/Services/ChatTests.cs on lines 287..289

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

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

            var result =
                await connection.Hub.InvokeAsync<SuccessOrError<IReadOnlyList<ChatMessageDto>>>(
                    nameof(CoreHub.FetchChatMessages), new FetchChatMessagesDto(channel, 0, -1));
src/Services/ConferenceManagement/Strive.IntegrationTests/Services/ChatTests.cs on lines 242..244
src/Services/ConferenceManagement/Strive.IntegrationTests/Services/ChatTests.cs on lines 259..261

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

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

            var result =
                await connection.Hub.InvokeAsync<SuccessOrError<IReadOnlyList<ChatMessageDto>>>(
                    nameof(CoreHub.FetchChatMessages), new FetchChatMessagesDto(channel, 0, -1));
src/Services/ConferenceManagement/Strive.IntegrationTests/Services/ChatTests.cs on lines 242..244
src/Services/ConferenceManagement/Strive.IntegrationTests/Services/ChatTests.cs on lines 287..289

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

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