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}`}>
Severity: Major
Found in client/app/bundles/Room/components/Invitation/index.jsx - About 4 hrs to fix

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

      render() {
        let onClickName;
        let buttonText;
        let buttonHtml;
        let secondButtonText;
    Severity: Major
    Found in client/app/bundles/Room/components/ActionBox/ActionBox.jsx - About 4 hrs to fix

      Class RoomsController has 32 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class RoomsController < ApplicationController
      
        include Premium
      
        before_action :guest_check, only: [:show, :leaflet_view]
      Severity: Minor
      Found in app/controllers/rooms_controller.rb - About 4 hrs to fix

        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?
        Severity: Minor
        Found in app/models/room.rb - About 3 hrs to fix

          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>
          Severity: Major
          Found in client/app/bundles/Room/components/StatusBar/mobile.jsx - About 3 hrs to fix

            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>
            Severity: Major
            Found in client/app/bundles/Room/components/StatusBar/desktop.jsx - About 2 hrs to fix

              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()
              Severity: Minor
              Found in client/app/libs/adapter.js - About 2 hrs to fix

              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;
                Severity: Minor
                Found in client/app/bundles/Room/components/ActionBox/ActionBox.jsx - About 2 hrs to fix

                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)
                Severity: Minor
                Found in client/app/bundles/Room/components/Board.jsx - About 2 hrs to fix

                  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"
                  Severity: Minor
                  Found in client/app/bundles/Room/components/PeopleListBox.jsx - About 1 hr to fix

                    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>
                    Severity: Minor
                    Found in client/app/bundles/Room/components/StatusBar/mobile.jsx - About 1 hr to fix

                    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>
                    Severity: Minor
                    Found in client/app/bundles/Room/components/StatusBar/desktop.jsx - About 1 hr to fix

                    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
                    Severity: Minor
                    Found in app/models/user.rb - About 1 hr to fix

                    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 = (() => {
                    Severity: Minor
                    Found in client/app/bundles/Room/components/Story.jsx - About 1 hr to fix

                      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
                      Severity: Minor
                      Found in client/app/bundles/Room/components/StoryListBox/mobile.jsx - About 1 hr to fix

                        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">
                        Severity: Minor
                        Found in client/app/bundles/Room/components/Invitation/index.jsx - About 1 hr to fix

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

                            render() {
                              const defaultArray = []
                              const syncLink = (() => {
                                if (this.props.role === "Moderator") {
                                  return(
                          Severity: Minor
                          Found in client/app/bundles/Room/components/StoryListBox/desktop.jsx - About 1 hr to fix

                            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()
                            Severity: Minor
                            Found in client/app/libs/adapter.js - About 1 hr to fix

                              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}>
                              Severity: Minor
                              Found in client/app/bundles/Room/components/Person.jsx - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language