Enegrecer/enegrecer-web

View on GitHub

Showing 15 of 357 total issues

Function colaboradores has 207 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function colaboradores() {
  return [
    {
      nome: 'Adriana Höher',
      papel: 'DEVa',
Severity: Major
Found in src/components/sobrePortal/colaboradores.js - About 1 day to fix

    Function detalhesOuCarregamento has 179 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function detalhesOuCarregamento(denuncia) {
      const { denunciante, agressor, vitima } = denuncia.pessoasEnvolvidas;
      let componente;
    
      if (denuncia) {
    Severity: Major
    Found in src/components/visualizarDenuncia/VisualizarDenuncia.js - About 7 hrs to fix

      Function detalhesOuCarregamento has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

      function detalhesOuCarregamento(denuncia) {
        const { denunciante, agressor, vitima } = denuncia.pessoasEnvolvidas;
        let componente;
      
        if (denuncia) {
      Severity: Minor
      Found in src/components/visualizarDenuncia/VisualizarDenuncia.js - About 7 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 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const { expanded } = this.state;
          const { denuncia } = this.props;
          const { agressao } = denuncia;
          const { vitima, denunciante } = denuncia.pessoasEnvolvidas;
      Severity: Major
      Found in src/components/moderador/DenunciaRow.js - About 2 hrs to fix

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

          render() {
            const { estadoDenunciante } = this.props.formDenuncia.values;
            return (
              <div>
                <div className="row">
        Severity: Major
        Found in src/components/denuncias/denunciante/DenuncianteForm.js - About 2 hrs to fix

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

            render() {
              return (
                <div className="navbar">
                  <div className="navbar-fixed">
                    <nav>
          Severity: Minor
          Found in src/components/navbar/Navbar.js - About 2 hrs to fix

            Function criarDenuncia has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function criarDenuncia(acao) {
              const refDenuncias = ref.child('denuncias');
              const dados = Object.assign({}, denunciaInicial, acao.payload);
            
              const idDenuncia = refDenuncias.push({
            Severity: Minor
            Found in src/sagas/denuncia/criar.js - About 2 hrs to fix

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

                render() {
                  const { email, senha, error } = this.state;
              
                  const isInvalid = senha === '' || email === '';
              
              
              Severity: Minor
              Found in src/components/moderador/ModeradorLogin.js - About 1 hr to fix

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

                  render() {
                    const { estadoDenunciante } = this.props.formDenuncia.values;
                    return (
                      <div>
                        <div className="row">
                Severity: Minor
                Found in src/components/denuncias/vitima/NovaVitimaForm.js - About 1 hr to fix

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

                    render() {
                      if (this.props.denunciaCadastradaComSucesso) {
                        return <Redirect to="/depois-denuncia" />;
                      }
                      return (
                  Severity: Minor
                  Found in src/containers/denuncias/NovaDenunciaContainer.js - About 1 hr to fix

                    Function Carregamento has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function Carregamento() {
                      return (
                        <div className="preloader-wrapper big active carregamento">
                          <div className="spinner-layer spinner-green">
                            <div className="circle-clipper left">
                    Severity: Minor
                    Found in src/components/comum/carregamento/Carregamento.js - About 1 hr to fix

                      Function navigationLinks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        navigationLinks() {
                          const links = [
                            { id: 1, to: '/sobre', label: 'SOBRE' },
                            { id: 2, to: '/depois-denuncia', label: 'E DEPOIS DA DENÚNCIA?' },
                            { id: 3, to: '/coletivo-enegrecer', label: 'O COLETIVO ENEGRECER' },
                      Severity: Minor
                      Found in src/components/navbar/Navbar.js - About 1 hr to fix

                        Function normalizePhone has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const normalizePhone = (value, previousValue) => {
                          if (!value) {
                            return value;
                          }
                          const onlyNums = value.replace(/[^\d]/g, '');
                        Severity: Minor
                        Found in src/components/comum/telefone/index.js - About 55 mins 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

                        Avoid too many return statements within this function.
                        Open

                          return `${onlyNums.slice(0, 2)} - ${onlyNums.slice(2, 7)} - ${onlyNums.slice(7, 11)}`;
                        Severity: Major
                        Found in src/components/comum/telefone/index.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return `${onlyNums.slice(0, 2)} - ${onlyNums.slice(2)}`;
                          Severity: Major
                          Found in src/components/comum/telefone/index.js - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language