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 modalContent = !list.length ? (<div>No participants registered</div>) : (
            <ListGroup
                style={{maxHeight:'288px', overflow:'auto'}}>
                {list.map(p => {
                    return (
Severity: Major
Found in src/js/components/AddPopin.js and 1 other location - About 6 hrs to fix
src/js/components/Users.js on lines 71..85

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 157.

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

        const usersList = !connectedUsers.length ? (<div>No participants registered</div>) : (
            <ListGroup
                style={{maxHeight:'288px', overflow:'auto'}}>
                {connectedUsers.map(p => {
                    return (
Severity: Major
Found in src/js/components/Users.js and 1 other location - About 6 hrs to fix
src/js/components/AddPopin.js on lines 48..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 157.

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

    _setModalState(showModal) {
        if(!this.state || this.state.showModal !== showModal) {
            this.setState({showModal});
        }
        if(this.state && !this.state.showModal) {
Severity: Major
Found in src/js/components/AddPopin.js and 1 other location - About 3 hrs to fix
src/js/components/CreatePopin.js on lines 20..28

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 104.

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

    _setModalState(showModal) {
        if(!this.state || this.state.showModal !== showModal) {
            this.setState({showModal});
        }
        if(this.state && !this.state.showModal) {
Severity: Major
Found in src/js/components/CreatePopin.js and 1 other location - About 3 hrs to fix
src/js/components/AddPopin.js on lines 17..25

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 104.

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

                <OverlayTrigger
                    trigger={['hover', 'focus']}
                    placement="left"
                    overlay={popoverHoverFocus('pop_audio_toggle', audioTitle)}>
                    <Button bsStyle="clear" bsSize="fab" onClick={this.toggleAudio.bind(this)}>
Severity: Major
Found in src/js/components/CmdButtons.js and 1 other location - About 3 hrs to fix
src/js/components/CmdButtons.js on lines 70..77

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 101.

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

                <OverlayTrigger
                    trigger={['hover', 'focus']}
                    placement="left"
                    overlay={popoverHoverFocus('pop_video_toggle', videoTitle)}>
                    <Button bsStyle="clear" bsSize="fab" onClick={this.toggleVideo.bind(this)}>
Severity: Major
Found in src/js/components/CmdButtons.js and 1 other location - About 3 hrs to fix
src/js/components/CmdButtons.js on lines 78..85

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 101.

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

    render() {
        const connectedUsers = this.props.users.filter(p => p.status === 'CONNECTED' && p.uid !== this.props.current);
        const usersList = !connectedUsers.length ? (<div>No participants registered</div>) : (
            <ListGroup
                style={{maxHeight:'288px', overflow:'auto'}}>
Severity: Major
Found in src/js/components/Users.js - About 3 hrs to fix

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

                    <OverlayTrigger
                        trigger={['hover', 'focus']}
                        placement="left"
                        overlay={popoverHoverFocus('pop_fullscreen_toggle', 'Toggle Fullscreen')}>
                        <Button bsStyle="clear" bsSize="fab" onClick={this.toggleFullScreen.bind(this)}>
    Severity: Major
    Found in src/js/components/CmdButtons.js and 3 other locations - About 3 hrs to fix
    src/js/components/CmdButtons.js on lines 58..65
    src/js/components/TopButtons.js on lines 35..42
    src/js/components/TopButtons.js on lines 43..50

    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 99.

    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 4 locations. Consider refactoring.
    Open

                    <OverlayTrigger
                        trigger={['hover', 'focus']}
                        placement="left"
                        overlay={popoverHoverFocus('pop_add', 'Add participant')}>
                        <Button bsStyle="clear" bsSize="fab" onClick={this.addParticipantToRoom.bind(this)}>
    Severity: Major
    Found in src/js/components/TopButtons.js and 3 other locations - About 3 hrs to fix
    src/js/components/CmdButtons.js on lines 58..65
    src/js/components/CmdButtons.js on lines 86..93
    src/js/components/TopButtons.js on lines 35..42

    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 99.

    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 4 locations. Consider refactoring.
    Open

                    <OverlayTrigger
                        trigger={['hover', 'focus']}
                        placement="left"
                        overlay={popoverHoverFocus('pop_quit', 'Quit room')}>
                        <Button bsStyle="clear" bsSize="fab" onClick={this.exit.bind(this)}>
    Severity: Major
    Found in src/js/components/TopButtons.js and 3 other locations - About 3 hrs to fix
    src/js/components/CmdButtons.js on lines 58..65
    src/js/components/CmdButtons.js on lines 86..93
    src/js/components/TopButtons.js on lines 43..50

    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 99.

    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 4 locations. Consider refactoring.
    Open

                    <OverlayTrigger
                        trigger={['hover', 'focus']}
                        placement="left"
                        overlay={popoverHoverFocus('pop_device_switch', 'Switch camera')}>
                        <Button bsStyle="clear" bsSize="fab" onClick={this.switchVideo.bind(this)}>
    Severity: Major
    Found in src/js/components/CmdButtons.js and 3 other locations - About 3 hrs to fix
    src/js/components/CmdButtons.js on lines 86..93
    src/js/components/TopButtons.js on lines 35..42
    src/js/components/TopButtons.js on lines 43..50

    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 99.

    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 STREAM_CHANGED:
                return {
                    ...state,
                    participants:
                        state.participants.map(u => {
    Severity: Major
    Found in src/js/reducers/room.js and 1 other location - About 2 hrs to fix
    src/js/reducers/room.js on lines 70..77

    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 89.

    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 STREAM_RECEIVED:
                return {
                    ...state,
                    participants:
                        state.participants.map((u) => {
    Severity: Major
    Found in src/js/reducers/room.js and 1 other location - About 2 hrs to fix
    src/js/reducers/room.js on lines 61..68

    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 89.

    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 53 lines of code (exceeds 25 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: Major
    Found in src/js/components/CmdButtons.js - About 2 hrs to fix

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

          render() {
              const { fields : { email, password, username } } = this.props;
              // ReduxFrom field props unknown to FormControl (causes warning since React 0.15.2)
              const unknownProps = [
                  'initialValue', 'autofill', 'onUpdate', 'valid', 'invalid',
      Severity: Minor
      Found in src/js/components/LoginForm.js - About 1 hr to fix

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

        export default function users(state = initialState, action = {}) {
            const _updateUser = () => state.map(p => p.uid === action.data.uid ? Object.assign({}, p, { ...action.data }) : p);
        
            switch (action.type) {
                case ADD_USER:
        Severity: Minor
        Found in src/js/reducers/users.js - About 1 hr to fix

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

          const listen = room => (dispatch, getState) => {
              const _room = rooms.find(room);
              if(_room) {
                  _room.on(Reach.events.room.STREAM_PUBLISHED, remoteStream => {
                      streams.add(remoteStream);
          Severity: Minor
          Found in src/js/actions/stream.js - About 1 hr to fix

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

                render() {
                    const size = !this.props.room.focus || this.props.room.focus === 'localVideo' ? 'big' : 'small';
                    return (
                        <div>
                            {this.props.children &&
            Severity: Minor
            Found in src/js/containers/VisioPage.js - About 1 hr to fix

              Function listenToJoinAndLeave has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const listenToJoinAndLeave = room => (dispatch, getState) => {
                  rooms.find(room).on(Reach.events.room.PARTICIPANT_ADDED, p => {
                      const user = getState().users.find(u => u.uid === p.uid);
                      dispatch({
                          type: PARTICIPANT_JOIN,
              Severity: Minor
              Found in src/js/actions/room.js - About 1 hr to fix

                Function _onceLogged has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const _onceLogged = (dispatch, getState) => currentUser => {
                    history.push('/users');
                
                    dispatch({
                        type: LOGGED,
                Severity: Minor
                Found in src/js/actions/user.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language