Showing 9 of 13 total issues
Function LabelModal
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const LabelModal = (props) => {
const { labelModal } = useSelector(state => ({
labelModal: state.label.labelModal
}))
Function ActionCable
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ActionCable = (props) => {
const dispatch = useDispatch()
useEffect(() => {
const cable = actioncable.createConsumer()
Function UserList
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const UserList = (props) => {
const { users, email } = useSelector(state => ({
users: state.user.users,
email: state.user.email
}))
Function received
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const received = (data) => {
const result = humps.camelizeKeys(data)
switch (result.type) {
case 'SET_RETROSPECTIVE':
dispatch(actions.global.setRetrospective({ retrospective: result.retrospective }))
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className="Retrospective">
<div className="Retrospective-content">
<div className="Retrospective-boards">
Function closestLabelIndex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
closestLabelIndex(kind, target) {
for (let i in this.props.labels[kind]) {
const label = this.props.labels[kind][i]
const node = findDOMNode(this.refs[`label_${label.id}`])
if (node == null) continue
- 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 findLabelPosition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function findLabelPosition(labels, id) {
for (let kind of ['keep', 'problem', 'try']) {
for (let i = 0; i < labels[kind].length; i++) {
const label = labels[kind][i]
if (label.id == id) {
- 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
Method create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create(data)
return unless authenticate_retrospective?
@user = User.find_by(email: data['email'])
unless @user
broadcast_to(type: 'SET_ALERT', alert: { type: 'error', messages: [I18n.t('channels.retrospectives.not_found_user')] })
- 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 LabelModal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const LabelModal = (props) => {
const { labelModal } = useSelector(state => ({
labelModal: state.label.labelModal
}))
- 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"