AppSaloon/socket.io-tester

View on GitHub

Showing 23 of 64 total issues

Function render has 106 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render () {
        const state = this.state
        const connected = state.tab.connected
        const messageInEditor = state.messageInEditor
        const messageInEditorObject = state.messageCollection[state.messageInEditor]
Severity: Major
Found in src/app/js/components/column/messageSender/MessageSenderView.js - About 4 hrs to fix

    File MessageSenderView.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * MessageSenderView
     *
     * Message editor
     */
    Severity: Minor
    Found in src/app/js/components/column/messageSender/MessageSenderView.js - About 3 hrs to fix

      Function GetLatestReleaseDownloads has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function GetLatestReleaseDownloads () {
        console.info('latest release: ', window.latest_release.tag)
        var downloadBaseUrl = window.latest_release.download_url
        var OSName, downloads
        if (window.navigator.userAgent.indexOf('Windows') != -1) {
      Severity: Major
      Found in docs/assets/js/getLatestReleaseDownloads.js - About 2 hrs to fix

        Function mapDispatchToProps has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function mapDispatchToProps (dispatch) {
            return {
                addEvent (id, event) {
                    dispatch({
                        type: 'ADD_EVENT',
        Severity: Minor
        Found in src/app/js/components/column/eventAdder/EventAdder.js - About 1 hr to fix

          Function changeType has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              changeType (e) {
                  const state = this.state
                  const messageCollection = state.messageCollection.slice()
                  const type = e.target.value
                  let isValid = true
          Severity: Minor
          Found in src/app/js/components/column/messageSender/MessageSenderView.js - About 1 hr to fix

            Function listenForChanges has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            function listenForChanges () {
                const state = getState()
                const id = this
                const storedConnection = storedConnections[id]
                const connection = state.connections.list[state.connections.connections[id].index]
            Severity: Minor
            Found in src/app/js/socketManager.js - 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 listenForChanges has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function listenForChanges () {
                const state = getState()
                const id = this
                const storedConnection = storedConnections[id]
                const connection = state.connections.list[state.connections.connections[id].index]
            Severity: Minor
            Found in src/app/js/socketManager.js - About 1 hr to fix

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

              function changeTabOrders (state, action) {
                  const list = state.list.map(t => ({...t}))
              
                  const originalOrder = list[state.connections[action.id].index].order
                  const newOrder = action.order
              Severity: Minor
              Found in src/app/js/reducers/connections.js - 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 render has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  render () {
                      const tab = this.state.tab
                      const connected = tab.connected
                      return (
                          <div className="column-block">
              Severity: Minor
              Found in src/app/js/components/column/eventAdder/EventAdderView.js - About 1 hr to fix

                Function getNextMessages has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    getNextMessages (sortedMessages, currentlyVisible) {
                        let newVisibleMessages
                
                        for ( const index in sortedMessages )
                            if ( sortedMessages[index].timestamp === currentlyVisible[0].timestamp ) {
                Severity: Minor
                Found in src/app/js/components/messages/MessagesView.js - 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 setPreviousTabActive has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    setPreviousTabActive () {
                        const id = this.props.activeTab
                        const list = this.props.connections.list
                
                        const filteredList = list.filter( tab => !tab.disabled )
                Severity: Minor
                Found in src/app/js/components/head/HeadView.js - About 1 hr to fix

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

                      setPreviousTabActive () {
                          const id = this.props.activeTab
                          const list = this.props.connections.list
                  
                          const filteredList = list.filter( tab => !tab.disabled )
                  Severity: Minor
                  Found in src/app/js/components/head/HeadView.js - 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 render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      render () {
                          const {event, handleCheckClick} = this.props
                          return (
                              <div className="column-list-item">
                                  <span
                  Severity: Minor
                  Found in src/app/js/components/column/eventAdder/EventListItem.js - About 1 hr to fix

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

                    function subscribeSendMessageListener () {
                    
                        let previousState = store.getState().sentMessages
                    
                        store.subscribe(function () {
                    Severity: Minor
                    Found in src/app/js/socketManager.js - About 1 hr to fix

                      Function GetLatestReleaseDownloads has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function GetLatestReleaseDownloads () {
                        console.info('latest release: ', window.latest_release.tag)
                        var downloadBaseUrl = window.latest_release.download_url
                        var OSName, downloads
                        if (window.navigator.userAgent.indexOf('Windows') != -1) {
                      Severity: Minor
                      Found in docs/assets/js/getLatestReleaseDownloads.js - 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 handleMessageChange has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          handleMessageChange (value) {
                              const state = this.state
                              const messageCollection = state.messageCollection.slice()
                              const messageInEditor = state.messageInEditor
                              const message = messageCollection[messageInEditor]
                      Severity: Minor
                      Found in src/app/js/components/column/messageSender/MessageSenderView.js - About 1 hr to fix

                        Function mapDispatchToProps has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function mapDispatchToProps (dispatch) {
                            return {
                                addConnection (id) {
                                    dispatch({
                                        type: 'ADD_CONNECTION',
                        Severity: Minor
                        Found in src/app/js/components/head/Head.js - About 1 hr to fix

                          Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              render () {
                                  const {isJson, parsed, messageType, raw} = this.state
                                  const showRaw = this.state.showRaw
                                  return (
                                      <div className="message-preview">
                          Severity: Minor
                          Found in src/app/js/components/messages/MessageView.js - About 1 hr to fix

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

                                getPreviousMessages (sortedMessages, currentlyVisible) {
                                    let newVisibleMessages
                            
                                    for ( const index in sortedMessages )
                                        if ( sortedMessages[index].timestamp === currentlyVisible.slice(-1)[0].timestamp ) {
                            Severity: Minor
                            Found in src/app/js/components/messages/MessagesView.js - 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 changeType has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                changeType (e) {
                                    const state = this.state
                                    const messageCollection = state.messageCollection.slice()
                                    const type = e.target.value
                                    let isValid = true
                            Severity: Minor
                            Found in src/app/js/components/column/messageSender/MessageSenderView.js - 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

                            Severity
                            Category
                            Status
                            Source
                            Language