Showing 7 of 7 total issues
Function render
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
render() {
const { errorTypes, errorMessages } = this.state;
return (
<React.Fragment>
Function render
has 60 lines of code (exceeds 50 allowed). Consider refactoring. Open
render() {
return (
<React.Fragment>
<div className="navigation">
<div className={this.state.linksClass} id="links">
Consider simplifying this complex logical expression. Open
if (
urlRx.test(message) ||
emailRx.test(message) ||
message.toLowerCase().includes('advertise') ||
message.toLowerCase().includes('million') ||
Function contact
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async function contact(req, res) {
const { email, message } = req.body;
const contactErrors = contactValidation(req.body);
- 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 scrollspy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
scrollspy() {
const threshold = window.innerHeight - 30;
this.scrollSpyID = requestAnimationFrame(() => {
if (window.scrollY > threshold && !this.state.scrolledPastHeader) {
- 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 handleSubmit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async handleSubmit(e: SyntheticEvent<*>) {
e.preventDefault();
log("Let's validate all your stuff first.");
const email = this.email ? this.email.value : '';
- 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 scrollspy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
scrollspy() {
this.scrollSpyID = requestAnimationFrame(() => {
if (window.scrollY > 90 && !this.state.visible) {
this.setState({
visible: true,
- 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"