Anapher/Strive

View on GitHub

Showing 250 of 735 total issues

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

Avoid too many return statements within this function.
Open

      return false;
Severity: Major
Found in src/Services/SFU/src/lib/conference/conference.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

       return 'ok';

      Avoid too many return statements within this function.
      Open

         return (
            <div>
               <Grid container spacing={2}>
                  <Grid item>
                     <StatusChip

        Avoid too many return statements within this function.
        Open

              return health.connection.receiveTransport.transportState;

          Avoid too many return statements within this function.
          Open

                return 'Connection not found'; // should not happen

            Avoid too many return statements within this function.
            Open

                  return { valid: false, error: 'conference.poll.types.numeric.error_not_match_step' };

              Avoid too many return statements within this function.
              Open

                    if (source === 'loopback-webcam' && kind === 'video') return true;
              Severity: Major
              Found in src/Services/SFU/src/lib/conference/conference.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return <RequestUserInteractionView />;
                Severity: Major
                Found in src/Web/WebSPA/Client/src/routes/EquipmentRoute.tsx - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return { success: true, response: { id: producer.id } };
                  Severity: Major
                  Found in src/Services/SFU/src/lib/conference/conference.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return t(`${webRtcNamespace}.transport_${health.connection.receiveTransport.transportState}.message`, {
                             transport: 'receive-transport',
                          });
                      Severity
                      Category
                      Status
                      Source
                      Language