Showing 35 of 51 total issues
Function TeamPage
has 877 lines of code (exceeds 50 allowed). Consider refactoring. Open
export default function TeamPage() {
// team member info list for use with modular component below
/* const teamMembers = [
{
img: 'https://i.ibb.co/cNtktWF/profile.jpg',
File team.spec.js
has 1293 lines of code (exceeds 250 allowed). Consider refactoring. Open
/// <reference types="Cypress" />
context('TEAM MEMBER PROFILES SECTION', () => {
before(() => {
/*
File teampage.js
has 880 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
//import TeamMemberInfo from './TeamMemberInfo';
export default function TeamPage() {
// team member info list for use with modular component below
Function SVGIcon
has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring. Open
const SVGIcon = React.memo(({ id, type, classes, divClass, onClick, size }) => (
//You can control the styling of the icons via classes or size or both.
//IconContext.Provider allows you to override styles as needed see for more info:
//https://www.npmjs.com/package/react-icons
//Component is set up to be flexible to your needs. If you use size for the icon
- 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 ProfileEdit
has 316 lines of code (exceeds 50 allowed). Consider refactoring. Open
export default function ProfileEdit(props) {
//State
const [fields, setFields] = useState({});
const [linkError, setLinkError] = useState(false);
const [showLinkInput, setLinkInput] = useState(false);
Consider simplifying this complex logical expression. Open
if (name?.length > 0) {
const pattern = new RegExp(name, 'i');
pendingConnections = pendingConnections.filter(
(c) =>
c.contact.name?.match(pattern) ||
Function NotificationsComponent
has 238 lines of code (exceeds 50 allowed). Consider refactoring. Open
export default function NotificationsComponent(props) {
const {
data,
dismissNotification,
notificationCount,
File tailwind.js
has 519 lines of code (exceeds 250 allowed). Consider refactoring. Open
module.exports = {
prefix: '',
important: false,
separator: ':',
theme: {
Function Settings
has 183 lines of code (exceeds 50 allowed). Consider refactoring. Open
export default function Settings(props) {
const [fields, setFields] = useState({
autoconnect: true,
});
File index.js
has 418 lines of code (exceeds 250 allowed). Consider refactoring. Open
import gql from 'graphql-tag';
export const USER_FILTER = gql`
query userFilter($id: ID!) {
user {
Function Features
has 144 lines of code (exceeds 50 allowed). Consider refactoring. Open
export default function Features() {
return (
<div className="container mx-auto px-12">
<h2 className="text-4xl flex justify-center font-sembold text-black-600 p-6" id="features">
Features
Function NavComponent
has 135 lines of code (exceeds 50 allowed). Consider refactoring. Open
export default function NavComponent(props) {
const {
open,
setOpen,
inHeader,
File profile-edit.js
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState, useEffect } from 'react';
import { useQuery, useMutation } from '@apollo/react-hooks';
import {
FETCH_USER_PROFILE,
UPDATE_USER_INFO,
Function UserInfo
has 123 lines of code (exceeds 50 allowed). Consider refactoring. Open
export default function UserInfo(props) {
const { data, qrcData, qrLink, qrPubLink, QRC } = props;
// false means the QR code is set to the one for SWAAP users
//const [toggleQR, setToggleQR] = useState(true);
Function NavBarLanding
has 117 lines of code (exceeds 50 allowed). Consider refactoring. Open
export default function NavBarLanding() {
const { loginWithRedirect } = useAuth0();
return (
<section className="antialiased bg-gray-200 mx-auto">
Function ProfileEdit
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export default function ProfileEdit(props) {
//State
const [fields, setFields] = useState({});
const [linkError, setLinkError] = useState(false);
const [showLinkInput, setLinkInput] = useState(false);
- 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 ScanQr
has 83 lines of code (exceeds 50 allowed). Consider refactoring. Open
const ScanQr = () => {
const [connections, setConnections] = useState([]);
const [position, setPosition] = useState({});
const [fetchQRCode, { data }] = useLazyQuery(FETCH_QRCODE_DATA);
const [errors, setErrors] = useState([]);
File profile.js
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import Popup from 'reactjs-popup';
import { useQuery, useMutation } from '@apollo/react-hooks';
import { Link } from '@reach/router';
import { FETCH_USER_PROFILE, DELETE_CONNECTION, GET_USER_CONNECTIONS } from '../../queries/index';
Function NavBar
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export default function NavBar({ inHeader, qr }) {
const [open, setOpen] = useState(false);
const qrcData = localStorage.getItem('qrCode');
- 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 PublicNavBar
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export default function PublicNavBar({ inHeader }) {
const [open, setOpen] = useState(false);
const { loading, error, data } = useQuery(NAVBAR_PROFILE);
- 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"