gwcuva/gwc-website

View on GitHub

Showing 113 of 372 total issues

Function Footer has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function Footer() {
  return (
    <div className="bg-peacock">
      <Row className={`${isMobile ? "footerLogoMobile" : "footerLogoDesktop"} position-absolute`}>
        <img src={whiteLogo} 
Severity: Minor
Found in src/components/CareerFair2022/Footer/Footer.tsx - 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 NavbarGHH has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function NavbarGHH() {

  const [navbar, setNavbar] = useState({'registration': '', 'mlhbanner': {'url': ''}, 'mlhwebsite': ''});

  useEffect(() => {
Severity: Major
Found in src/components/GirlsHooHack2022/NavbarGHH/NavbarGHH.tsx - About 2 hrs to fix

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

    function NavbarGHH() {
    
      const [navbar, setNavbar] = useState({'registration': '', 'mlhbanner': {'url': ''}, 'mlhwebsite': ''});
    
      useEffect(() => {
    Severity: Major
    Found in src/components/GirlsHooHack2023/NavbarGHH/NavbarGHH.tsx - About 2 hrs to fix

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

      function MobileHeader(props: Props) {
          
          const [header, setHeader] = useState({'year': 2022, 'month': '', 'day': '', 'format': '', 'registration': ''});
      
          useEffect(() => {
      Severity: Minor
      Found in src/components/GirlsHooHack2022/Header/MobileHeader.tsx - About 2 hrs to fix

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

        function Newsletter() {
            const emailInput = useRef<HTMLInputElement>(null);
            const endpoint = process.env.REACT_APP_GRAPHCMS_URL ? process.env.REACT_APP_GRAPHCMS_URL : "";
            const graphcmsToken = process.env.REACT_APP_GRAPHCMS_TOKEN ? process.env.REACT_APP_GRAPHCMS_TOKEN : "";
            const graphQLClient = new GraphQLClient(endpoint, {
        Severity: Minor
        Found in src/components/GirlsHooHack2023/Newsletter/Newsletter.tsx - About 2 hrs to fix

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

          function Newsletter() {
              const emailInput = useRef<HTMLInputElement>(null);
              const endpoint = process.env.REACT_APP_GRAPHCMS_URL ? process.env.REACT_APP_GRAPHCMS_URL : "";
              const graphcmsToken = process.env.REACT_APP_GRAPHCMS_TOKEN ? process.env.REACT_APP_GRAPHCMS_TOKEN : "";
              const graphQLClient = new GraphQLClient(endpoint, {
          Severity: Minor
          Found in src/components/GirlsHooHack2022/Newsletter/Newsletter.tsx - About 2 hrs to fix

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

            function MobileHeader(props: Props) {
                
                const [header, setHeader] = useState({'year': 2023, 'month': '', 'day': '', 'format': '', 'registration': ''});
            
                useEffect(() => {
            Severity: Minor
            Found in src/components/GirlsHooHack2023/Header/MobileHeader.tsx - About 2 hrs to fix

              Function MobileHeader has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function MobileHeader(props: Props) {
                  const [header, setHeader] = useState({'year': 2023, 'month': '', 'day': '', 'format': '', 'registration': '', 'time': ''});
              
                useEffect(() => {
                  const fetchHeader = async () => {
              Severity: Minor
              Found in src/components/CareerFair2023/Header/MobileHeader.tsx - About 1 hr to fix

                Function MobileHeader has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function MobileHeader(props: Props) {
                    const [header, setHeader] = useState({'year': 2022, 'month': '', 'day': '', 'format': '', 'registration': '', 'time': ''});
                
                  useEffect(() => {
                    const fetchHeader = async () => {
                Severity: Minor
                Found in src/components/CareerFair2022/Header/MobileHeader.tsx - About 1 hr to fix

                  Function MobileHeader has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function MobileHeader(props: Props) {
                      const [header, setHeader] = useState({'year': 2024, 'month': '', 'day': '', 'format': '', 'registration': '', 'time': ''});
                  
                    useEffect(() => {
                      const fetchHeader = async () => {
                  Severity: Minor
                  Found in src/components/CareerFair2024/Header/MobileHeader.tsx - About 1 hr to fix

                    Function Prizes has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function Prizes(): JSX.Element {
                      const [prizes, setPrizes] = useState([{'id': '', 'prizeName': '', 'prizeObject': '', 'description': ''}]);
                    
                      useEffect(() => {
                        const fetchPrizes = async () => {
                    Severity: Minor
                    Found in src/components/GirlsHooHack2023/Prizes/Prizes.tsx - About 1 hr to fix

                      Function Prizes has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function Prizes(): JSX.Element {
                        const [prizes, setPrizes] = useState([{'id': '', 'prizeName': '', 'prizeObject': '', 'description': ''}]);
                      
                        useEffect(() => {
                          const fetchPrizes = async () => {
                      Severity: Minor
                      Found in src/components/GirlsHooHack2022/Prizes/Prizes.tsx - About 1 hr to fix

                        Function Prizes has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function Prizes(): JSX.Element {
                          const [prizes, setPrizes] = useState([{'id': '', 'prizeName': '', 'prizeObject': '', 'description': ''}]);
                        
                          useEffect(() => {
                            const fetchPrizes = async () => {
                        Severity: Minor
                        Found in src/components/GirlsHooHack2021/Prizes/Prizes.tsx - About 1 hr to fix

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

                          function About() {
                            const [description, setDescription] = useState([{'id': '', 'ghhDescription': '', 'gwcDescription': ''}]);
                            let ghhDescription = [];
                            let gwcDescription = [];
                            
                          Severity: Minor
                          Found in src/components/GirlsHooHack2021/About/About.tsx - About 1 hr to fix

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

                                const fetchTeam = async () => {
                                  const { executiveMembers } = await request(
                                    process.env.REACT_APP_GRAPHCMS_URL ? process.env.REACT_APP_GRAPHCMS_URL : "",
                                    `
                                      { 
                            Severity: Minor
                            Found in src/components/Main/Team/Team.tsx - About 1 hr to fix

                              Function Newsletter has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function Newsletter() {
                                  const emailInput = useRef<HTMLInputElement>(null);
                                  const endpoint = process.env.REACT_APP_GRAPHCMS_URL ? process.env.REACT_APP_GRAPHCMS_URL : "";
                                  const graphcmsToken = process.env.REACT_APP_GRAPHCMS_TOKEN ? process.env.REACT_APP_GRAPHCMS_TOKEN : "";
                                  const graphQLClient = new GraphQLClient(endpoint, {
                              Severity: Minor
                              Found in src/components/GirlsHooHack2023/Newsletter/Newsletter.tsx - 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 Newsletter has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function Newsletter() {
                                  const emailInput = useRef<HTMLInputElement>(null);
                                  const endpoint = process.env.REACT_APP_GRAPHCMS_URL ? process.env.REACT_APP_GRAPHCMS_URL : "";
                                  const graphcmsToken = process.env.REACT_APP_GRAPHCMS_TOKEN ? process.env.REACT_APP_GRAPHCMS_TOKEN : "";
                                  const graphQLClient = new GraphQLClient(endpoint, {
                              Severity: Minor
                              Found in src/components/GirlsHooHack2022/Newsletter/Newsletter.tsx - 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 MobileHeader has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function MobileHeader(props: Props) {
                                  return(
                                      <div id={props.id} className="container-fluid bg-turq">
                                          <meta id="viewport" name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"></meta>
                                          <Row>
                              Severity: Minor
                              Found in src/components/GirlsHooHack2021/Header/MobileHeader.tsx - About 1 hr to fix

                                Function Links has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function Links() {
                                  const [links, setLinks] = useState([{'title': '', 'link': '', 'id': ''}]);
                                  
                                  useEffect(() => {
                                    const fetchLinks = async () => {
                                Severity: Minor
                                Found in src/components/Links/Links.tsx - About 1 hr to fix

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

                                  function Podcast(props: Props) {
                                      return (
                                          <div id={props.id} className="pb-5">
                                              <Row className="justify-content-center">
                                                  <Col lg={6} md={8} sm={10} xs={11}>
                                  Severity: Minor
                                  Found in src/components/Main/Podcast/Podcast.tsx - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language