Anapher/Strive

View on GitHub

Showing 735 of 735 total issues

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

   notifyProducerChanged(connectionId: string, args: ProducerChangedEventArgs): Promise<void> {
      return this.notifyConnection({ connectionId, methodName: 'producerChanged', payload: args });
   }
Severity: Major
Found in src/Services/SFU/src/lib/synchronization/rabbit-pub.ts and 7 other locations - About 1 hr to fix
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 16..18
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 20..22
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 24..26
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 28..30
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 32..34
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 36..38
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 44..46

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

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

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

   applyPatch({ value }: SyncStatePayload, state: any): void {
      const currentStateValue = state[this.descriptor.propertyName];
      applyPatch(currentStateValue, value);
   }
src/Web/WebSPA/Client/src/store/signal/synchronization/synchronized-property.ts on lines 29..32

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

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

   private onConsumerScore({ consumerId, score }: ConsumerScorePayload) {
      this.consumerManager.updateConsumerInfo(consumerId, { score });
      log('[Consumer: %s] Receive consumer score: %O', consumerId, score);
   }
Severity: Major
Found in src/Web/WebSPA/Client/src/store/webrtc/WebRtcConnection.ts and 1 other location - About 1 hr to fix
src/Web/WebSPA/Client/src/store/webrtc/WebRtcConnection.ts on lines 207..210

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

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

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

   applyPatch({ value }: SyncStatePayload, state: any): void {
      const currentStateValue = state[this.descriptor.propertyName];
      applyPatch(currentStateValue, value);
   }
src/Web/WebSPA/Client/src/store/signal/synchronization/synchronized-property.ts on lines 51..54

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

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

   notifyConsumerResumed(connectionId: string, args: ConsumerArgs): Promise<void> {
      return this.notifyConnection({ connectionId, methodName: 'consumerResumed', payload: args });
   }
Severity: Major
Found in src/Services/SFU/src/lib/synchronization/rabbit-pub.ts and 7 other locations - About 1 hr to fix
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 16..18
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 20..22
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 28..30
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 32..34
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 36..38
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 40..42
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 44..46

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

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

   notifyConsumerLayersChanged(connectionId: string, args: ConsumerLayersChanged): Promise<void> {
      return this.notifyConnection({ connectionId, methodName: 'layersChanged', payload: args });
   }
Severity: Major
Found in src/Services/SFU/src/lib/synchronization/rabbit-pub.ts and 7 other locations - About 1 hr to fix
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 16..18
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 20..22
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 24..26
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 28..30
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 32..34
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 40..42
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 44..46

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

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

   notifyProducerScore(connectionId: string, args: ProducerScoreInfo): Promise<void> {
      return this.notifyConnection({ connectionId, methodName: 'producerScore', payload: args });
   }
Severity: Major
Found in src/Services/SFU/src/lib/synchronization/rabbit-pub.ts and 7 other locations - About 1 hr to fix
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 16..18
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 20..22
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 24..26
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 28..30
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 32..34
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 36..38
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 40..42

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

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

   notifyConsumerScore(connectionId: string, args: ConsumerScoreArgs): Promise<void> {
      return this.notifyConnection({ connectionId, methodName: 'consumerScore', payload: args });
   }
Severity: Major
Found in src/Services/SFU/src/lib/synchronization/rabbit-pub.ts and 7 other locations - About 1 hr to fix
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 16..18
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 20..22
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 24..26
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 32..34
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 36..38
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 40..42
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 44..46

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

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

   private onLayersChanged({ consumerId, layers }: LayersChangedPayload) {
      this.consumerManager.updateConsumerInfo(consumerId, { currentLayers: layers });
      log('[Consumer: %s] Receive consumer layers: %O', consumerId, layers);
   }
Severity: Major
Found in src/Web/WebSPA/Client/src/store/webrtc/WebRtcConnection.ts and 1 other location - About 1 hr to fix
src/Web/WebSPA/Client/src/store/webrtc/WebRtcConnection.ts on lines 202..205

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

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

   notifyConsumerPaused(connectionId: string, args: ConsumerArgs): Promise<void> {
      return this.notifyConnection({ connectionId, methodName: 'consumerPaused', payload: args });
   }
Severity: Major
Found in src/Services/SFU/src/lib/synchronization/rabbit-pub.ts and 7 other locations - About 1 hr to fix
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 16..18
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 24..26
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 28..30
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 32..34
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 36..38
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 40..42
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 44..46

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

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

   notifyConsumerCreated(connectionId: string, args: ConsumerCreatedArgs): Promise<void> {
      return this.notifyConnection({ connectionId, methodName: 'newConsumer', payload: args });
   }
Severity: Major
Found in src/Services/SFU/src/lib/synchronization/rabbit-pub.ts and 7 other locations - About 1 hr to fix
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 16..18
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 20..22
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 24..26
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 28..30
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 36..38
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 40..42
src/Services/SFU/src/lib/synchronization/rabbit-pub.ts on lines 44..46

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

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 getPollDescription = (instruction: MultipleChoiceInstruction, t: TFunction<string>) =>
   instruction.maxSelections
      ? t('conference.poll.types.multiple_choice.description', { count: instruction.maxSelections })
      : t('conference.poll.types.multiple_choice.label');
src/Web/WebSPA/Client/src/features/poll/types/tag-cloud/index.ts on lines 8..11

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

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 getPollDescription = (instruction: TagCloudInstruction, t: TFunction<string>) =>
   instruction.maxTags
      ? t('conference.poll.types.tag_cloud.description_max', { count: instruction.maxTags })
      : t('conference.poll.types.tag_cloud.label');
src/Web/WebSPA/Client/src/features/poll/types/multiple-choice/index.ts on lines 8..11

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

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

      [coreHub.fetchChatMessages.returnAction]: (
         state,
         {
            payload,
            meta,
Severity: Minor
Found in src/Web/WebSPA/Client/src/features/chat/reducer.ts - About 1 hr 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 TagCloudAnswerForm has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export default function TagCloudAnswerForm({
   poll: { poll, answer },
   footerPortalRef,
   onSubmit,
   onDelete,

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

export default function SceneView() {
   const classes = useStyles();
   const [contentRef, dimensions] = useThrottledResizeObserver(100);

   const sceneStack = useSelector(selectSceneStack);
Severity: Minor
Found in src/Web/WebSPA/Client/src/features/scenes/components/SceneView.tsx - About 1 hr 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 removeProducer has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

   public removeProducer(producerId: string): void {
      const producer = this.producers.get(producerId);
      if (producer) {
         this.producers.delete(producerId);

Severity: Minor
Found in src/Services/SFU/src/lib/media-soup/mediasoup-mixer.ts - About 1 hr 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 SendMessageForm has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export default function SendMessageForm({ onSendMessage, isTyping, channel }: Props) {
   const dispatch = useDispatch();
   const { t } = useTranslation();

   const [message, setMessage] = useState('');

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

   createSelector(selectLocalDevices, selectEquipmentConnections, getSource, (devices, equipment, source) => {
      const result = new Array<DeviceGroup>();

      if (devices) {
         const localDevices = devices
Severity: Minor
Found in src/Web/WebSPA/Client/src/features/settings/selectors.tsx - About 1 hr to fix

    Function registerConferenceEvents has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

       private async registerConferenceEvents(id: string, conference: Conference): Promise<void> {
          await this.repository.addMessageHandler(id, async (message) => {
             switch (message.type) {
                case 'conferenceInfoUpdated':
                   const unfreezeCallback = conference.streamInfoRepo.freeze();
    Severity: Minor
    Found in src/Services/SFU/src/lib/conference/conference-manager.ts - About 1 hr to fix
      Severity
      Category
      Status
      Source
      Language