Showing 25 of 83 total issues
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'}}>
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';
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',
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:
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);
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 &&
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,
Function _onceLogged
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const _onceLogged = (dispatch, getState) => currentUser => {
history.push('/users');
dispatch({
type: LOGGED,
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,
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) {
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();
- Read upRead up
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>) : (
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 => {
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 = [
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,
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'
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');
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) {
- Read upRead up
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';
- Read upRead up
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 subscribe
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const subscribe = (remoteStream, videoTab) => (dispatch, getState) => {
if (getState().room.participants.find(u => u.subscribed && u.stream && u.stream.uid === remoteStream.uid )) {
return;
}
const _stream = streams.find(remoteStream);