Showing 17 of 206 total issues
Function Feed
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function Feed(props) {
const classes = useStyles();
const [anchorEl, setAnchorEl] = useState(null)
const [updates, setUpdates] = useState('')
const { handleDeletePost } = props
Function render
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
render() {
const { classes } = this.props;
return (
<Dialog
fullWidth={true}
Function NewUpdate
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function NewUpdate(props) {
const classes = useStyles();
const dateAux = props.date ? parseHourMinute(props.date) : parseHourMinute(new Date())
const [date, setDate] = useState(dateAux)
Function render
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
export default function EndBroadcastAlert(props) {
const classes = useStyles();
const { onClose, value: valueProp, action, open } = props;
const [value, setValue] = React.useState(valueProp);
Function SummaryBox
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function SummaryBox(props) {
const classes = useStyles();
const sessionID = props.sessionID;
const [textFieldValue, setTextFieldValue] = useState('');
function handleChange(e) {
Function StartBroadcastAlert
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
export default function URLInputDialog(props) {
const [validURL, setValidURL] = useState(false)
const [urlInput, setURLInput] = useState('')
const [standardProtocol] = useState('https://')
Function render
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(){
const { classes } = this.props;
if(this.state.succesfullLogin) {
return <Redirect to={ESTUDIO_PAGE_URL}/>
Function Header
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function Header(props){
const classes = useStyles();
const [startBroadcastDialogOpen, setStartBroadcastDialogOpen] = useState(false)
const [endBroadcastDialogOpen, setEndBroadcastDialogOpen] = useState(false)
const [userInput, setUserInput] = useState(false)
Function ExternalContentPanel
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function ExternalContentPanel(props) {
const classes = useStyles();
const [value, setValue] = React.useState(0);
const handleChange = (event, newValue) => {
Function componentDidMount
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
async componentDidMount() {
let updates = await fetchFeedUpdates(this.state.sessionID)
if (updates.length > 0) {
for (let i = 0; i < updates.length; i++) {
try {
- 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
Open
render() {
const { classes } = this.props;
return (
<div className={classes.body} testid="timeline">
<Header setBroadcastingStatus={this.props.setBroadcastingStatus}
Function URLInputDialog
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function URLInputDialog(props) {
const [validURL, setValidURL] = useState(false)
const [urlInput, setURLInput] = useState('')
const [standardProtocol] = useState('https://')
- 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 registerValidSW
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function registerValidSW(swUrl, config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
Function StatusSelection
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function StatusSelection(props) {
const classes = useStyles();
const [titlesArray] = useState([
'Pré-sessão',
'Sessão Iniciada',