Showing 30 of 59 total issues
Function render
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const emailForm = () => {
const emailFields = this.state.emails.map((email, index) => {
return(
<div className="row" key={`${email}-${index}`}>
Function render
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let onClickName;
let buttonText;
let buttonHtml;
let secondButtonText;
Class RoomsController
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class RoomsController < ApplicationController
include Premium
before_action :guest_check, only: [:show, :leaflet_view]
Class Room
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class Room < ApplicationRecord
include UidGeneration
include PgSearch::Model
multisearchable :against => [:name], :unless => :discarded_at?
Function render
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const roomStatusButton = (() => {
if ('Moderator' === this.state.role) {
return (
<a onClick={this.closeRoom}>๐ Close</a>
Function render
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const roomStatusButton = (() => {
if ('Moderator' === this.state.role) {
return (
<button type="button" onClick={this.closeRoom} className="btn btn-default close-room">๐ Close room</button>
Function handleMessage
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function handleMessage(data) {
// console.dir(data)
if (data.type === 'action') {
if (data.data === 'open') {
RoomActions.showResultSection()
- 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 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
// TODO
// Gotta find out why it could be null sometimes
if (!this.state.data) {
return null
Function render
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
render() {
let onClickName;
let buttonText;
let buttonHtml;
let secondButtonText;
- 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 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let totalPoints = 0;
const dataNodes = this.state.data.map(story => {
if(!isNaN(story.point)) {
totalPoints += Number(story.point)
Function render
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const editLink = (() => {
let icon, text
if (this.state.editable) {
icon = "fa-check"
Function render
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
render() {
const roomStatusButton = (() => {
if ('Moderator' === this.state.role) {
return (
<a onClick={this.closeRoom}>๐ Close</a>
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
render() {
const roomStatusButton = (() => {
if ('Moderator' === this.state.role) {
return (
<button type="button" onClick={this.closeRoom} className="btn btn-default close-room">๐ Close room</button>
- 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 find_for_oauth
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def self.find_for_oauth(auth, signed_in_resource = nil)
# Get the identity and user if they exist
identity = Authorization.find_for_oauth(auth)
# If a signed_in_resource is provided it always overrides the existing 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 render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const that = this;
let revoteIcon;
let liElementClass;
revoteIcon = (() => {
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const defaultArray = [];
const ticketHeading = (() => {
if (this.state.data.ungroomed && this.state.data.ungroomed.length) {
return this.state.data.ungroomed[0].link
Function emailForm
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const emailForm = () => {
const emailFields = this.state.emails.map((email, index) => {
return(
<div className="row" key={`${email}-${index}`}>
<div className="col-xs-8">
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const defaultArray = []
const syncLink = (() => {
if (this.props.role === "Moderator") {
return(
Function handleMessage
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleMessage(data) {
// console.dir(data)
if (data.type === 'action') {
if (data.data === 'open') {
RoomActions.showResultSection()
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const accessoryLabel = ((() => {
if (this.props.editable && this.props.currentUserId !== this.props.id) {
return(
<span className="accessory pull-right" onClick={this.remove}>