Anapher/Strive

View on GitHub

Showing 250 of 735 total issues

Function onLiveUpdateReceived has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

   private onLiveUpdateReceived(update: WhiteboardLiveUpdateDto) {
      if (!this.currentCanvas) return;

      if (update.action.type === 'end') {
         this.removeLiveUpdate(update.participantId);
Severity: Minor
Found in src/Web/WebSPA/Client/src/features/whiteboard/whiteboard-controller.ts - About 25 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 index has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function index({ conference }: Props) {
   const userInteractionMade = useSelector((state: RootState) => state.media.userInteractionMade);
   const playSoundOnConferenceOpen = useSelector((state: RootState) => state.settings.obj.conference.playSoundOnOpen);

   const myId = useMyParticipantId();
Severity: Minor
Found in src/Web/WebSPA/Client/src/features/conference/components/index.tsx - About 25 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 removeConnection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

   public async removeConnection(connectionId: string): Promise<SuccessOrError> {
      const connection = this.connections.get(connectionId);
      if (!connection) return { success: false, error: errors.connectionNotFound(connectionId) };

      this.connections.delete(connection.connectionId);
Severity: Minor
Found in src/Services/SFU/src/lib/conference/conference.ts - About 25 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 ErrorWrapper has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function ErrorWrapper({ failed, children, error, onRetry, type = 'alert' }: Props) {
   const classes = useStyles();
   const { t } = useTranslation();

   return failed ? (
Severity: Minor
Found in src/Web/WebSPA/Client/src/components/ErrorWrapper.tsx - About 25 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 apply has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

   apply(fc: fabric.Canvas, action: ModifyingObjectsCanvasLiveAction, currentCanvas: WhiteboardCanvas): void {
      const objects = fc.getObjects();

      const previousEdited = [...this.modifiedObjs];
      this.modifiedObjs = [];
Severity: Minor
Found in src/Web/WebSPA/Client/src/features/whiteboard/live-update-handler.ts - About 25 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 WebcamSettingsTest has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function WebcamSettingsTest() {
   const classes = useStyles();
   const myId = useMyParticipantId();
   const { t } = useTranslation();
   const consumer = useConsumer(myId, 'loopback-webcam');

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

export default function EquipmentRoute({
   location,
   match: {
      params: { id },
   },
Severity: Minor
Found in src/Web/WebSPA/Client/src/routes/EquipmentRoute.tsx - About 25 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 clearChat has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      clearChat(state) {
         if (state.channels) {
            for (const channel of Object.values(state.channels)) {
               if (channel.viewModel) channel.viewModel.messages = [];
            }
Severity: Minor
Found in src/Web/WebSPA/Client/src/features/chat/reducer.ts - About 25 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 unregisterConsumer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

   private unregisterConsumer(id: string): void {
      log('Unregister consumer %s', id);

      let currentUsage = this.consumerUsage.get(id);
      if (currentUsage === undefined) {
Severity: Minor
Found in src/Web/WebSPA/Client/src/store/webrtc/consumer-usage-control.ts - About 25 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 onMouseDown has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

   onMouseDown(event: IEvent): void {
      if (event.target) return;

      const canvas = this.getCanvas();
      if (canvas.getActiveObject()) return;
Severity: Minor
Found in src/Web/WebSPA/Client/src/features/whiteboard/tools/TextTool.ts - About 25 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

Severity
Category
Status
Source
Language