Anapher/Strive

View on GitHub

Showing 250 of 735 total issues

Function preprocess has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

   public preprocess(canvas: WhiteboardCanvas): WhiteboardCanvas {
      const requiredPathIds = Object.fromEntries(Array.from(this.uncompressedPaths.keys()).map((x) => [x, false]));

      const uncompressPath = (obj: VersionedCanvasObject) => {
         requiredPathIds[obj.id] = true;
Severity: Minor
Found in src/Web/WebSPA/Client/src/features/whiteboard/path-cache.ts - About 55 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 UpdateBreakoutRoomsDialog has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export default function UpdateBreakoutRoomsDialog({ active, onClose }: Props) {
   const dispatch = useDispatch();
   const { t } = useTranslation();

   // the duration changes every second, so remmeber the initial duration to create a meaningful diff

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

export default function CreateConferenceForm({
   defaultValues,
   onSubmit,
   isSubmitting,
   onClose,

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

export default function DetailedErrorStatus({ health: { connection, connector } }: Props) {
   const { t } = useTranslation();

   if (connector.status !== 'ok') {
      if (connector.webRtcStatus === 'connecting') {

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

export default function TroubleshootMicrophone({ expanded, onChange }: Props) {
   const { t } = useTranslation();
   const gain = useSelector((state: RootState) => state.settings.obj.mic.audioGain);

   const localMic = useMicrophone(gain, true);

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

   private async initialize(): Promise<void> {
      const signalr = appHubConn.current;
      if (!signalr) {
         throw new Error('SignalR connection is not available.');
      }
Severity: Minor
Found in src/Web/WebSPA/Client/src/store/webrtc/WebRtcManager.ts - About 45 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 TabCommon has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export default function TabCommon({
   form: {
      control,
      watch,
      register,

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

export default function RenderPollScene({ className, scene, dimensions }: RenderSceneProps<PollScene>) {
   const classes = useStyles();
   const { t } = useTranslation();
   const canOpenPoll = usePermission(POLL_CAN_OPEN);
   const dispatch = useDispatch();

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

Avoid deeply nested control flow statements.
Open

                  if (action.payload.success === true) {
                     toast.success(handler.successMessage, { id: handler.toastId });
                  } else if (action.payload.success === false) {
                     toast.error(formatErrorMessage(action.payload.error), { id: handler.toastId });
                  } else {
Severity: Major
Found in src/Web/WebSPA/Client/src/store/notifier/create-middleware.ts - About 45 mins to fix

    Function updateLocalDevices has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function* updateLocalDevices({ payload }: PayloadAction<InputDeviceDto[]>) {
       const deviceSettings: StriveSettings = yield select((state: RootState) => state.settings.obj);
    
       for (const producerDevice of ProducerDevices) {
          const device = deviceSettings[producerDevice].device;
    Severity: Minor
    Found in src/Web/WebSPA/Client/src/features/settings/sagas.ts - About 45 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 useBottomScrollTrigger has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function useBottomScrollTrigger(props: UseScrollTriggerOptions) {
       return useScrollTrigger({
          ...props,
          getTrigger: (store: any, options: any) => {
             const { disableHysteresis = false, threshold = 100, target } = options;
    Severity: Minor
    Found in src/Web/WebSPA/Client/src/hooks/useBottomScrollTrigger.ts - About 45 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 NumericAnswerForm has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function NumericAnswerForm({
       poll: { poll, answer },
       footerPortalRef,
       onSubmit,
    }: PollAnswerFormProps<NumericAnswer>) {

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

    export default function AudioSettingsTest() {
       const classes = useStyles();
       const { t } = useTranslation();
    
       const myId = useMyParticipantId();

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

    function mapToViewModels(layers: PermissionLayer[]): PermissionLayerViewModel[] {
       const appliedValues = new Map<string, string>();
       const result = new Array<PermissionLayerViewModel>();
    
       for (const layer of _(layers)

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

    function* updateEquipment() {
       const equipment: SynchronizedEquipment | null = yield select((state: RootState) => state.media.equipment);
       const deviceSettings: StriveSettings = yield select((state: RootState) => state.settings.obj);
    
       for (const producerDevice of ProducerDevices) {
    Severity: Minor
    Found in src/Web/WebSPA/Client/src/features/settings/sagas.ts - About 45 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 generateGrid has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export function generateGrid(
       itemsCount: number,
       itemMaxWidth: number,
       boundingBox: Size,
       spacing: number,
    Severity: Minor
    Found in src/Web/WebSPA/Client/src/features/scenes/calculations.ts - About 45 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 removeParticipant has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

       public async removeParticipant(participantId: string): Promise<SuccessOrError> {
          logger.info('removeParticipant() | participantId: %s', participantId);
    
          const participant = this.participants.get(participantId);
          if (!participant) return { success: false, error: errors.participantNotFound(participantId) };
    Severity: Minor
    Found in src/Services/SFU/src/lib/conference/conference.ts - About 45 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 verifyProducerSource has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

       private verifyProducerSource(kind: MediaKind, source: ProducerSource): boolean {
          if (source === 'mic' && kind === 'audio') return true;
          if (source === 'screen' && kind === 'video') return true;
          if (source === 'webcam' && kind === 'video') return true;
    
    
    Severity: Minor
    Found in src/Services/SFU/src/lib/conference/conference.ts - About 45 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 compareArrays has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export function compareArrays<T>(a1?: T[], a2?: T[]) {
       if (!a1 && !a2) return true;
       if (!a1 || !a2) return false;
    
       if (a1.length !== a2.length) return false;
    Severity: Minor
    Found in src/Web/WebSPA/Client/src/utils/array-utils.ts - About 45 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 RenderWhiteboard has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function RenderWhiteboard({ scene, dimensions }: RenderSceneProps<WhiteboardScene>) {
       const whiteboard = useSelector((state: RootState) => selectWhiteboard(state, scene.id));
       const dispatch = useDispatch();
       const myId = useMyParticipantId();
       const paricipants = useSelector(selectParticipantsOfCurrentRoom);

    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