webcom-components/visio-sample

View on GitHub

Showing 83 of 83 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    const _updateRoom = () => state.map(p => p.uid === action.data.uid ? Object.assign({}, p, { ...action.data }) : p);
Severity: Major
Found in src/js/reducers/rooms.js and 1 other location - About 1 hr to fix
src/js/reducers/users.js on lines 14..14

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 63.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function ref has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const ref = () => {
    if(!_reach) {
        const
            logLevel = __DEVTOOLS__ ? 'INFO' : 'ERROR',
            preferredAudioCodec = Reach.codecs.audio.OPUS,
Severity: Minor
Found in src/js/utils/reach.js - About 1 hr to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        const _updateUser = () => state.map(p => p.uid === action.data.uid ? Object.assign({}, p, { ...action.data }) : p);
    Severity: Major
    Found in src/js/reducers/users.js and 1 other location - About 1 hr to fix
    src/js/reducers/rooms.js on lines 10..10

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 63.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    const send = (invitee, room) => {
        return (dispatch, getState) => {
            Promise.resolve(rooms.find(room))
                .then(_room => {
                    if(!_room) {
    Severity: Minor
    Found in src/js/actions/invite.js - About 1 hr to fix

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

      export const toggleFullscreen = () => {
          if (!document.fullscreenElement &&    // alternative standard method
              !document.mozFullScreenElement && !document.webkitFullscreenElement) {  // current working methods
              if (document.documentElement.requestFullscreen) {
                  document.documentElement.requestFullscreen();
      Severity: Minor
      Found in src/js/utils/index.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 showModal = this.state && this.state.showModal;
              const _inRoom = p => this.props.room.participants.find(u => u.uid === p.uid && u.status === 'CONNECTED');
              const list = this.props.users.filter(p => p.status === 'CONNECTED' && !_inRoom(p));
              const modalContent = !list.length ? (<div>No participants registered</div>) : (
      Severity: Minor
      Found in src/js/components/AddPopin.js - About 1 hr to fix

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

        const leave = (user, room, newRoom) => dispatch => {
            const _room = rooms.find(room);
            _room.remoteStreams()
                .then(remoteStreams => {
                    remoteStreams.forEach(remoteStream => {
        Severity: Minor
        Found in src/js/actions/room.js - About 1 hr to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                              <Col md={6}>
                                  <Panel
                                      header={<h4>Connected users</h4>}
                                      className="users">
                                      {usersList}
          Severity: Major
          Found in src/js/components/Users.js and 1 other location - About 1 hr to fix
          src/js/components/Users.js on lines 137..143

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 59.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                              <Col md={6}>
                                  <Panel
                                      header={<h4>Public Rooms</h4>}
                                      className="rooms">
                                      {roomsList}
          Severity: Major
          Found in src/js/components/Users.js and 1 other location - About 1 hr to fix
          src/js/components/Users.js on lines 144..150

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 59.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  const users = this.props.room.participants.filter(u => u.stream && u.uid !== this.props.current.uid);
          Severity: Major
          Found in src/js/containers/VisioPage.js and 1 other location - About 1 hr to fix
          src/js/containers/VisioPage.js on lines 106..106

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 59.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  const users = this.props.room.participants.filter(u => u.stream && u.uid !== this.props.current.uid);
          Severity: Major
          Found in src/js/containers/VisioPage.js and 1 other location - About 1 hr to fix
          src/js/containers/VisioPage.js on lines 62..62

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 59.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

              render() {
                  const showModal = this.state && this.state.showModal;
                  const { fields : { roomName } } = this.props;
                  // ReduxFrom field props unknown to FormControl (causes warning since React 0.15.2)
                  const unknownProps = [
          Severity: Minor
          Found in src/js/components/CreatePopin.js - About 1 hr to fix

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

            export default function user(state = initialState, action = {}) {
                switch (action.type) {
                    case LOGGED:
                        return {
                            ...initialState,
            Severity: Minor
            Found in src/js/reducers/current.js - About 1 hr to fix

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

                  render() {
                      const { fields : { message } } = this.props;
                      const unknownProps = [
                          'initialValue', 'autofill', 'onUpdate', 'valid', 'invalid',
                          'dirty', 'pristine', 'active', 'touched', 'visited', 'autofilled'
              Severity: Minor
              Found in src/js/components/Chat.js - About 1 hr to fix

                Function configureStore has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function configureStore(reduxRouterMiddleware, initialState) {
                    let createStoreWithMiddleware;
                
                    if (typeof __DEVTOOLS__ !== 'undefined' && __DEVTOOLS__) {
                        const DevTools = require('../containers/DevTools');
                Severity: Minor
                Found in src/js/store/configureStore.js - About 1 hr to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          case ADD_USER:
                              return state.find(p => p.uid === action.data.uid) ? _updateUser() : [
                                  ...state,
                                  {...action.data}
                              ];
                  Severity: Major
                  Found in src/js/reducers/users.js and 1 other location - About 1 hr to fix
                  src/js/reducers/rooms.js on lines 13..17

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 57.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          case ADD_ROOM:
                              return state.find(p => p.uid === action.data.uid) ? _updateRoom() : [
                                  ...state,
                                  {...action.data}
                              ];
                  Severity: Major
                  Found in src/js/reducers/rooms.js and 1 other location - About 1 hr to fix
                  src/js/reducers/users.js on lines 17..21

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 57.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                  const answered = (accept, invitee, info) => {
                      return (dispatch, getState) => {
                          rooms.add(info.room);
                  
                          if(accept && invitee.uid === getState().current.uid) {
                  Severity: Minor
                  Found in src/js/actions/invite.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 a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      render() {
                          let audioIcon = 'mic_on', videoIcon = 'videocam';
                          if (this.props.stream && this.props.stream.muted) {
                              audioIcon = this.props.stream.muted.audio ? 'mic_off' : 'mic_on';
                              videoIcon = this.props.stream.muted.video ? 'videocam_off' : 'videocam';
                  Severity: Minor
                  Found in src/js/components/CmdButtons.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 componentDidUpdate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      componentDidUpdate() {
                          const users = this.props.room.participants.filter(u => u.stream && u.uid !== this.props.current.uid);
                  
                          const remoteVideos = $(ReactDom.findDOMNode(this.refs.remoteVideos));
                          // Add or update published streams
                  Severity: Minor
                  Found in src/js/containers/VisioPage.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language