Lambda-School-Labs/kansha-fe

View on GitHub

Showing 43 of 187 total issues

Function OrganizationHome has 190 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const OrganizationHome = () => {
    const titleArr = ['Employees', 'Teams'];
    // Button states
    const [empButton, setEmpButton] = useState(true);
    const [createTeamsBtn, setCreateTeamsBtn] = useState(false);
Severity: Major
Found in src/components/AdminTeams/OrganizationHome.jsx - About 7 hrs to fix

    Function AboutUs has 148 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function AboutUs() {
        const labs21 = [
            {
                name: 'Andrew Ackerman',
                job: 'Web Developer',
    Severity: Major
    Found in src/components/Landing/AboutUs.jsx - About 5 hrs to fix

      Function feedReducer has 141 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const feedReducer = (state = initialState, action) => {
          switch (action.type) {
              case FEED_LOAD_START:
                  return {
                      ...state,
      Severity: Major
      Found in src/store/reducers/feed-reducer.js - About 5 hrs to fix

        Function userReducer has 104 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const userReducer = (state = initialState, action) => {
            switch (action.type) {
                /*
                dispatched by the authorizeUser action creator
                */
        Severity: Major
        Found in src/store/reducers/user-reducer.js - About 4 hrs to fix

          Function S4AUserUpload has 100 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function S4AUserUpload() {
              const [uploadNow, setUploadNow] = useState('');
              const [uploadMethod, setUploadMethod] = useState('');
          
              let history = useHistory();
          Severity: Major
          Found in src/components/Onboarding/S4AUserUpload.jsx - About 4 hrs to fix

            Function TeamMemberList has 97 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function TeamMemberList() {
                const [modal, setModal] = useState(false);
                const [teamDetails, setTeamDetails] = useState();
                const [filter, setFilter] = useState('');
                const [loadingState, setLoadingState] = useState(true);
            Severity: Major
            Found in src/components/AdminTeams/TeamMemberList.jsx - About 3 hrs to fix

              Function App has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const App = () => {
                  const [init, setInit] = useState({
                      fetched: false,
                      error: false,
                      onboarding: false,
              Severity: Major
              Found in src/App.jsx - About 3 hrs to fix

                Function Profile has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function Profile() {
                    const [badges, setBadges] = useState([]);
                
                    const [profileData, setProfileData] = useState({});
                    const { comments, profile, feed } = useSelector(({ liveFeed, user }) => ({
                Severity: Major
                Found in src/components/Profile/Profile.jsx - About 3 hrs to fix

                  Function Onboarding has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function Onboarding() {
                      const [user, setUser] = useState({
                          first_name: '',
                          last_name: '',
                          email: '',
                  Severity: Major
                  Found in src/components/Onboarding/Onboarding.jsx - About 3 hrs to fix

                    Function ListOfFeatures has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function ListOfFeatures() {
                        return (
                            <section className="list-of-features-container">
                                <h2>Recognize, motivate, and track accomplishments.</h2>
                                <section>
                    Severity: Major
                    Found in src/components/Landing/ListOfFeatures.jsx - About 2 hrs to fix

                      Function Feed has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const Feed = () => {
                          const [selectedRec, setSelectedRec] = useState();
                          const [badges, setBadges] = useState([]);
                          const { feed, comments, reactions, profile } = useSelector(
                              ({ liveFeed, user }) => ({
                      Severity: Major
                      Found in src/components/Feed/index.jsx - About 2 hrs to fix

                        Function timeAgo has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const timeAgo = timestamp => {
                            // get time in milliseconds
                            const currentTime = new Date(Date.now()).getTime();
                            const eventTime = new Date(timestamp).getTime()
                        
                        
                        Severity: Minor
                        Found in src/utils/timeago.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 Reports has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function Reports() {
                            const [filter, setFilter] = useState('weeks');
                        
                            const handleFilter = (e) => {
                                setFilter(e);
                        Severity: Major
                        Found in src/components/AdminDashboard/Reports.jsx - About 2 hrs to fix

                          Function FeedSideBar has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function FeedSideBar() {
                              const [open, setOpen] = React.useState(false);
                              const [, setSelectedRec] = useState();
                              const [, setSelectedProfile] = useState();
                              const [badges, setBadges] = useState([]);
                          Severity: Major
                          Found in src/components/FeedSideBar/index.jsx - About 2 hrs to fix

                            Function Profile has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export function Profile() {
                                const [badges, setBadges] = useState([]);
                            
                                const [profileData, setProfileData] = useState({});
                                const { comments, profile, feed } = useSelector(({ liveFeed, user }) => ({
                            Severity: Minor
                            Found in src/components/Profile/Profile.jsx - 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 Settings has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function Settings() {
                                const { profile } = useSelector(({ user }) => ({
                                    ...user,
                                }));
                                const dispatch = useDispatch();
                            Severity: Major
                            Found in src/components/Settings.jsx - About 2 hrs to fix

                              Function Workspace has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function Workspace() {
                                  const [team, setTeam] = useState([]);
                                  const [filter, setFilter] = useState('');
                                  const history = useHistory();
                                  const { profile } = useSelector(({ user }) => ({
                              Severity: Major
                              Found in src/components/Workspace/index.jsx - About 2 hrs to fix

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

                                const OrganizationHome = () => {
                                    const titleArr = ['Employees', 'Teams'];
                                    // Button states
                                    const [empButton, setEmpButton] = useState(true);
                                    const [createTeamsBtn, setCreateTeamsBtn] = useState(false);
                                Severity: Minor
                                Found in src/components/AdminTeams/OrganizationHome.jsx - 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 ProfileModal has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function ProfileModal({
                                    profile, // this is the profile info for the logged in user
                                    badges, // this a list of all the badges in the system
                                    close, // function
                                    setProfileSelect, // function that determines whether the modal is open
                                Severity: Minor
                                Found in src/components/FeedSideBar/ProfileModal.jsx - 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 FileUpload has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const FileUpload = ({ close }) => {
                                    const [src, setSrc] = useState({});
                                    const [imageRef, setImageRef] = useState();
                                    const [croppedImg, setCroppedImg] = useState();
                                    const [file, setFile] = useState();
                                Severity: Minor
                                Found in src/components/FileUpload/index.jsx - 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