Lambda-School-Labs/conference-contacts-fe

View on GitHub

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',
Severity: Major
Found in src/components/Landing/teampage.js - About 4 days to fix

    File team.spec.js has 1293 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /// <reference types="Cypress" />
    
    context('TEAM MEMBER PROFILES SECTION', () => {
        before(() => {
            /* 
    Severity: Major
    Found in cypress/integration/team.spec.js - About 3 days to fix

      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
      Severity: Major
      Found in src/components/Landing/teampage.js - About 2 days to fix

        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
        Severity: Minor
        Found in src/components/SocialLinks/SocialIcons/SVGIcon.js - About 1 day 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 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);
        Severity: Major
        Found in src/pages/App/profile-edit.js - About 1 day to fix

          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) ||
          Severity: Critical
          Found in src/pages/App/contacts.js - About 1 day to fix

            Function NotificationsComponent has 238 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            export default function NotificationsComponent(props) {
              const {
                data,
                dismissNotification,
                notificationCount,
            Severity: Major
            Found in src/components/Home/notificationsComponent.js - About 1 day to fix

              File tailwind.js has 519 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              module.exports = {
                  prefix: '',
                  important: false,
                  separator: ':',
                  theme: {
              Severity: Major
              Found in src/tailwind.js - About 1 day to fix

                Function Settings has 183 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                export default function Settings(props) {
                  const [fields, setFields] = useState({
                    autoconnect: true,
                  });
                
                
                Severity: Major
                Found in src/pages/App/settings.js - About 6 hrs to fix

                  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 {
                  Severity: Minor
                  Found in src/queries/index.js - About 6 hrs to fix

                    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
                    Severity: Major
                    Found in src/components/Landing/features.js - About 4 hrs to fix

                      Function NavComponent has 135 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      export default function NavComponent(props) {
                        const {
                          open,
                          setOpen,
                          inHeader,
                      Severity: Major
                      Found in src/components/Nav/navComponent.js - About 4 hrs to fix

                        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,
                        Severity: Minor
                        Found in src/pages/App/profile-edit.js - About 4 hrs to fix

                          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);
                          
                          
                          Severity: Major
                          Found in src/components/Home/userInfo.js - About 3 hrs to fix

                            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">
                            Severity: Major
                            Found in src/containers/navbarlanding.js - About 3 hrs to fix

                              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);
                              Severity: Minor
                              Found in src/pages/App/profile-edit.js - About 2 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 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([]);
                              Severity: Major
                              Found in src/pages/App/scanqr.js - About 2 hrs to fix

                                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';
                                Severity: Minor
                                Found in src/pages/App/profile.js - About 2 hrs to fix

                                  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');
                                  
                                  
                                  Severity: Minor
                                  Found in src/containers/navbar.js - About 1 hr 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 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);
                                  
                                  
                                  Severity: Minor
                                  Found in src/containers/publicnavbar.js - About 1 hr 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language