Anapher/Strive

View on GitHub

Showing 250 of 735 total issues

Function useWebRtcConnectionHealth has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function useWebRtcConnectionHealth(): SfuConnectionHealth | undefined {
   const connection = useWebRtc();
   const [health, setHealth] = useState<SfuConnectionHealth | undefined>();

   useEffect(() => {

    Method Aggregate_CaseInsensitive_BuildCloud has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            [Fact]
            public async Task Aggregate_CaseInsensitive_BuildCloud()
            {
                // arrange
                var aggregator = new TagCloudAggregator();

      Function synchronizeObjectState has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function synchronizeObjectState<TS = any>(
         requests: SynchronizeProperty | SynchronizeProperty[],
         syncObjDeletedCallback?: (state: TS, syncObjId: string) => void,
      ) {
         if (!Array.isArray(requests)) {
      Severity: Minor
      Found in src/Web/WebSPA/Client/src/store/signal/synchronized-object.ts - About 1 hr to fix

        Function selectAvailableInputDevicesFactory has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        export const selectAvailableInputDevicesFactory = () =>
           createSelector(selectLocalDevices, selectEquipmentConnections, getSource, (devices, equipment, source) => {
              const result = new Array<DeviceGroup>();
        
              if (devices) {
        Severity: Minor
        Found in src/Web/WebSPA/Client/src/features/settings/selectors.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 DeviceSelector has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function DeviceSelector({ devices, defaultName, className, selectedDevice, onChange, label }: Props) {
           const selectId = defaultName.toLowerCase() + '-select';
           const classes = useStyles();
           const dispatch = useDispatch();
           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 ParticipantContextMenuTempPermissions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function ParticipantContextMenuTempPermissions({ participantId }: Props) {
           const { t } = useTranslation();
           const tempPermissions = useSelector((state: RootState) => selectParticipantTempPermissions(state, participantId));
           const dispatch = useDispatch();
           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

        Function registerValidSW has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function registerValidSW(swUrl: string, config?: Config) {
          navigator.serviceWorker
            .register(swUrl)
            .then(registration => {
              registration.onupdatefound = () => {
        Severity: Minor
        Found in src/Web/WebSPA/Client/src/serviceWorker.ts - About 1 hr to fix

          Function handleKeyPress has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

             const handleKeyPress = (key: string, ctrl: boolean, shift: boolean) => {
                if (readOnly) return;
          
                if (key === 'z' && ctrl && !shift) {
                   if (canUndo) onUndo();

            Function createReceiveTransport has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

               public async createReceiveTransport(): Promise<Transport> {
                  this.pendingConsumers = [];
            
                  const transportOptions = await this.client.createTransport({ producing: false, consuming: true });
            
            
            Severity: Minor
            Found in src/Web/WebSPA/Client/src/store/webrtc/WebRtcConnection.ts - About 1 hr to fix

              Function wrapControl has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function wrapControl(
                 source: ProducerSource,
                 device: AnyInputDevice | undefined,
                 local: UseMediaState,
                 equipment: Record<string, EquipmentConnection> | undefined,
              Severity: Minor
              Found in src/Web/WebSPA/Client/src/features/media/useDeviceManagement.ts - About 1 hr to fix

                Method ApplyScene has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private async Task ApplyScene(string conferenceId, string roomId, ActiveScene scene, SceneState currentState)
                        {
                            var sceneState = await CreateNewSceneState(conferenceId, roomId, scene, currentState);
                            await _sceneRepository.SetSceneState(conferenceId, roomId, sceneState);
                
                

                  Method HandleInternal has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          private async Task<SuccessOrError<Unit>> HandleInternal(PatchConferenceRequest request,
                              CancellationToken cancellationToken)
                          {
                              var (conferenceId, patch) = request;
                  
                  

                    Method TalkingStick_Moderated_Return_RemovePresenter has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            [Fact]
                            public async Task TalkingStick_Moderated_Return_RemovePresenter()
                            {
                                // arrange
                                var (conn, conference) = await ConnectToOpenedConference();

                      Function executeCommand has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                               const executeCommand = async () => {
                                  try {
                                     switch (command.action) {
                                        case 'enable':
                                           await control.enable();

                        Function mapStats has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const mapStats = (report: RTCStatsReport): StatsRow[] => {
                           const stats = Array.from(report);
                           return [
                              ...stats
                                 .filter(([, value]) => value.type === 'transport')

                          Function RoomsList has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export default function RoomsList() {
                             const classes = useStyles();
                          
                             const rooms = useSelector(selectRoomViewModels);
                             const participants = useSelector(selectParticipants);
                          Severity: Minor
                          Found in src/Web/WebSPA/Client/src/features/rooms/components/RoomsList.tsx - About 1 hr to fix

                            Function App has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function App() {
                               return (
                                  <MuiPickersUtilsProvider utils={LuxonUtils}>
                                     <ThemeProvider theme={theme}>
                                        <MaterialUiToaster />
                            Severity: Minor
                            Found in src/Web/WebSPA/Client/src/App.tsx - About 1 hr to fix

                              Method CloseConference_PollsOpen_DeleteAllPolls has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      [Fact]
                                      public async Task CloseConference_PollsOpen_DeleteAllPolls()
                                      {
                                          // arrange
                                          var (connection, _) = await ConnectToOpenedConference();

                                Method EnforceGlobalLimit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        private void EnforceGlobalLimit(Dictionary<string, ParticipantWhiteboardState> states)
                                        {
                                            var totalHistory = states.Sum(x => x.Value.RedoList.Count + x.Value.UndoList.Count);
                                            if (totalHistory > _options.MaxUndoHistory)
                                            {

                                  Function CommandHistory has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export default function CommandHistory() {
                                     const { t } = useTranslation();
                                     const history = useSelector((state: RootState) => state.equipment.commandHistory);
                                     const devices = useSelector(selectLocalDevices);
                                  
                                  
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language