Showing 15 of 357 total issues
Function colaboradores
has 207 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function colaboradores() {
return [
{
nome: 'Adriana Höher',
papel: 'DEVa',
Function detalhesOuCarregamento
has 179 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function detalhesOuCarregamento(denuncia) {
const { denunciante, agressor, vitima } = denuncia.pessoasEnvolvidas;
let componente;
if (denuncia) {
Function detalhesOuCarregamento
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
Open
function detalhesOuCarregamento(denuncia) {
const { denunciante, agressor, vitima } = denuncia.pessoasEnvolvidas;
let componente;
if (denuncia) {
- 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 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { expanded } = this.state;
const { denuncia } = this.props;
const { agressao } = denuncia;
const { vitima, denunciante } = denuncia.pessoasEnvolvidas;
Function render
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { estadoDenunciante } = this.props.formDenuncia.values;
return (
<div>
<div className="row">
Function render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div className="navbar">
<div className="navbar-fixed">
<nav>
Function criarDenuncia
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function criarDenuncia(acao) {
const refDenuncias = ref.child('denuncias');
const dados = Object.assign({}, denunciaInicial, acao.payload);
const idDenuncia = refDenuncias.push({
Function render
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { email, senha, error } = this.state;
const isInvalid = senha === '' || email === '';
Function render
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { estadoDenunciante } = this.props.formDenuncia.values;
return (
<div>
<div className="row">
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
if (this.props.denunciaCadastradaComSucesso) {
return <Redirect to="/depois-denuncia" />;
}
return (
Function Carregamento
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function Carregamento() {
return (
<div className="preloader-wrapper big active carregamento">
<div className="spinner-layer spinner-green">
<div className="circle-clipper left">
Function navigationLinks
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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' },
Function normalizePhone
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
const normalizePhone = (value, previousValue) => {
if (!value) {
return value;
}
const onlyNums = value.replace(/[^\d]/g, '');
- 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
Avoid too many return
statements within this function. Open
Open
return `${onlyNums.slice(0, 2)} - ${onlyNums.slice(2, 7)} - ${onlyNums.slice(7, 11)}`;
Avoid too many return
statements within this function. Open
Open
return `${onlyNums.slice(0, 2)} - ${onlyNums.slice(2)}`;