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]
File MessageSenderView.js
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* MessageSenderView
*
* Message editor
*/
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) {
Function mapDispatchToProps
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mapDispatchToProps (dispatch) {
return {
addEvent (id, event) {
dispatch({
type: 'ADD_EVENT',
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
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]
- 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 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]
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
- 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 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">
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 ) {
- 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 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 )
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 )
- 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 {event, handleCheckClick} = this.props
return (
<div className="column-list-item">
<span
Function subscribeSendMessageListener
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function subscribeSendMessageListener () {
let previousState = store.getState().sentMessages
store.subscribe(function () {
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) {
- 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 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">
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]
Function mapDispatchToProps
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mapDispatchToProps (dispatch) {
return {
addConnection (id) {
dispatch({
type: 'ADD_CONNECTION',
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 ) {
- 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 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
- 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"