labhackercd/linguagem-simples-front

View on GitHub

Showing 17 of 206 total issues

Function Feed has 136 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function Feed(props) {
  const classes = useStyles();
    const [anchorEl, setAnchorEl] = useState(null)
    const [updates, setUpdates] = useState('')
    const { handleDeletePost } = props
Severity: Major
Found in src/components/Dashboard/Timeline/Feed/index.js - About 5 hrs to fix

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

        render(){
        const { classes } = this.props;
        
        if(this.state.sucessfullCreatedSession) {
            return <Redirect to={DASHBOARD_BASE_URL+this.state.idSessionCreatedToRedirect}/>

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

          render() {
              const { classes } = this.props;
              return (
                  <Dialog
                      fullWidth={true}
      Severity: Major
      Found in src/components/Dashboard/Timeline/Dialogs/Preview/index.js - About 3 hrs to fix

        Function NewUpdate has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function NewUpdate(props) {
          const classes = useStyles();
            const dateAux = props.date ? parseHourMinute(props.date) : parseHourMinute(new Date())
            const [date, setDate] = useState(dateAux)
        
        
        Severity: Major
        Found in src/components/Dashboard/Timeline/NewUpdate/index.js - About 2 hrs to fix

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

              render(){
                  const { classes } = this.props;
          
                  if(!this.state.dataLoaded){
                      return (<Box display="flex" justifyContent="center" alignItems="center">

            Function EndBroadcastAlert has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function EndBroadcastAlert(props) {
              const classes = useStyles();
                const { onClose, value: valueProp, action, open } = props;
                const [value, setValue] = React.useState(valueProp);
            
            
            Severity: Major
            Found in src/components/Dashboard/Timeline/Dialogs/Alert/EndBroadcast/index.js - About 2 hrs to fix

              Function SummaryBox has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function SummaryBox(props) {
                const classes = useStyles();
                const sessionID = props.sessionID;
                const [textFieldValue, setTextFieldValue] = useState('');
                function handleChange(e) {
              Severity: Major
              Found in src/components/Dashboard/Timeline/SummaryBox/index.js - About 2 hrs to fix

                Function StartBroadcastAlert has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function StartBroadcastAlert(props) {
                    const classes = useStyles();
                    const { onClose, value: valueProp, action, open } = props;
                    const [value, setValue] = React.useState(valueProp);
                
                

                  Function URLInputDialog has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function URLInputDialog(props) {
                      const [validURL, setValidURL] = useState(false)
                      const [urlInput, setURLInput] = useState('')
                      const [standardProtocol] = useState('https://')
                  
                  
                  Severity: Major
                  Found in src/components/Dashboard/Timeline/Dialogs/URLInput/index.js - About 2 hrs to fix

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

                      render(){
                        const { classes } = this.props;
                    
                          if(this.state.succesfullLogin) {
                            return <Redirect to={ESTUDIO_PAGE_URL}/>
                    Severity: Major
                    Found in src/containers/LoginScreenContainer/index.js - About 2 hrs to fix

                      Function Header has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function Header(props){
                          const classes = useStyles();
                        const [startBroadcastDialogOpen, setStartBroadcastDialogOpen] = useState(false)
                        const [endBroadcastDialogOpen, setEndBroadcastDialogOpen] = useState(false)
                        const [userInput, setUserInput] = useState(false)
                      Severity: Major
                      Found in src/components/Dashboard/Timeline/Header/index.js - About 2 hrs to fix

                        Function ExternalContentPanel has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function ExternalContentPanel(props) {
                          const classes = useStyles();
                          const [value, setValue] = React.useState(0);
                        
                          const handleChange = (event, newValue) => {
                        Severity: Major
                        Found in src/components/Dashboard/Content/externalContentPanel.js - About 2 hrs to fix

                          Function componentDidMount has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  async componentDidMount() {
                                      let updates = await fetchFeedUpdates(this.state.sessionID)
                                      if (updates.length > 0) {
                                          for (let i = 0; i < updates.length; i++) {
                                              try {
                          Severity: Minor
                          Found in src/components/Dashboard/Timeline/index.js - 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 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  render() {
                                      const { classes } = this.props;
                                      return (
                                          <div className={classes.body} testid="timeline">
                                          <Header setBroadcastingStatus={this.props.setBroadcastingStatus}
                          Severity: Minor
                          Found in src/components/Dashboard/Timeline/index.js - About 1 hr to fix

                            Function URLInputDialog has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export default function URLInputDialog(props) {
                                const [validURL, setValidURL] = useState(false)
                                const [urlInput, setURLInput] = useState('')
                                const [standardProtocol] = useState('https://')
                            
                            
                            Severity: Minor
                            Found in src/components/Dashboard/Timeline/Dialogs/URLInput/index.js - 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 registerValidSW has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function registerValidSW(swUrl, config) {
                              navigator.serviceWorker
                                .register(swUrl)
                                .then(registration => {
                                  registration.onupdatefound = () => {
                            Severity: Minor
                            Found in src/serviceWorker.js - About 1 hr to fix

                              Function StatusSelection has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function StatusSelection(props) {
                                const classes = useStyles();
                                const [titlesArray] = useState([
                                                                'Pré-sessão',
                                                                'Sessão Iniciada',
                              Severity: Minor
                              Found in src/components/Dashboard/Timeline/StatusSelection/index.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language