Anapher/Strive

View on GitHub

Showing 250 of 735 total issues

Function ClassConference has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function ClassConference() {
   const classes = useStyles();

   const showChat = useSelector(selectShowChat);

    Class SceneTalkingStickTests has 21 methods (exceeds 20 allowed). Consider refactoring.
    Open

        public class SceneTalkingStickTests : ServiceIntegrationTest
        {
            private const string ConferenceId = TestData.ConferenceId;
            private const string DefaultRoomId = RoomOptions.DEFAULT_ROOM_ID;
    
    

      Function updateCanvas has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

         public updateCanvas(canvas: WhiteboardCanvas) {
            canvas = this.pathCache.preprocess(canvas); // paths must be unpacked from point array to svg paths
            const newVersion = _.maxBy(canvas.objects, (x) => x.version)?.version ?? 0;
      
            if (!this.currentVersion) {

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

         public async createSendTransport(): Promise<Transport> {
            const transportOptions = await this.client.createTransport({
               sctpCapabilities: this.device.sctpCapabilities,
               producing: true,
               consuming: false,
      Severity: Major
      Found in src/Web/WebSPA/Client/src/store/webrtc/WebRtcConnection.ts - About 2 hrs to fix

        Method Login has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                [HttpPost]
                [ValidateAntiForgeryToken]
                public async Task<IActionResult> Login(LoginInputModel model, string button)
                {
                    // check if we are in the context of an authorization request

          Method CreatePatch has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public void CreatePatch(JToken original, JToken modified, JsonPatchPath path, IPatchContext context)
                  {
                      var originalArr = (JArray) original;
                      var modifiedArr = (JArray) modified;
          
          
          Severity: Minor
          Found in src/Libs/JsonPatchGenerator/Handlers/ArrayPatchTypeHandler.cs - About 1 hr to fix

            Function AudioSettings has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function AudioSettings() {
               const classes = useStyles();
               const { t } = useTranslation();
               const audioGain = useSelector((state: RootState) => state.settings.obj.mic.audioGain);
               const audioDevice = useSelector((state: RootState) => state.settings.obj.mic.device);

              Function useConsumer has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function useConsumer(
                 participantId: string | undefined,
                 kind: ProducerSource,
              ): Consumer | null | undefined {
                 const [consumer, setConsumer] = useState<Consumer | null | undefined>(undefined);
              Severity: Minor
              Found in src/Web/WebSPA/Client/src/store/webrtc/hooks/useConsumer.ts - About 1 hr to fix

                Function About has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function About() {
                   const { t } = useTranslation();
                   const classes = useStyles();
                
                   return (
                Severity: Minor
                Found in src/Web/WebSPA/Client/src/features/settings/components/About.tsx - About 1 hr to fix

                  Function AudioSettingsTest has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Function onMouseDown has 43 lines of code (exceeds 25 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 1 hr to fix

                      Function Settings has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function Settings() {
                         const classes = useStyles();
                         const [value, setValue] = React.useState(0);
                         const { t } = useTranslation();
                      
                      
                      Severity: Minor
                      Found in src/Web/WebSPA/Client/src/features/settings/components/Settings.tsx - About 1 hr to fix

                        Method OpenBreakoutRooms_MoveToBreakoutRoom_UpdatePermissions has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                [Fact]
                                public async Task OpenBreakoutRooms_MoveToBreakoutRoom_UpdatePermissions()
                                {
                                    const int amount = 1;
                        
                        

                          Function generateGrid has 41 lines of code (exceeds 25 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 1 hr to fix

                            Function main has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            async function main() {
                               const lightship = createLightship({ detectKubernetes: false });
                            
                               const rabbitConn = new RabbitMqConn(config.services.rabbitMq);
                            
                            
                            Severity: Minor
                            Found in src/Services/SFU/src/index.ts - About 1 hr to fix

                              Function initialize has 41 lines of code (exceeds 25 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 1 hr to fix

                                Method Handle has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        public async Task<Unit> Handle(SubmitAnswerRequest request, CancellationToken cancellationToken)
                                        {
                                            var (participant, pollId, answer) = request;
                                
                                            var poll = await _repository.GetPoll(participant.ConferenceId, pollId);

                                  Function AudioRecorderTest has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export default function AudioRecorderTest({ stream, className }: Props) {
                                     if (!window.MediaRecorder) {
                                        return null;
                                     }
                                  
                                  

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

                                  export default function SceneManagement() {
                                     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 changeStream has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                     public async changeStream({ id, type, action }: ChangeStreamRequest, connectionId: string): Promise<SuccessOrError> {
                                        const connection = this.connections.get(connectionId);
                                        if (!connection) {
                                           return { success: false, error: errors.connectionNotFound(connectionId) };
                                        }
                                  Severity: Minor
                                  Found in src/Services/SFU/src/lib/conference/conference.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language