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);
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',
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,
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
*/
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();
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);
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,
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 }) => ({
Function Onboarding
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Onboarding() {
const [user, setUser] = useState({
first_name: '',
last_name: '',
email: '',
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>
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 }) => ({
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()
- 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 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);
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([]);
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 }) => ({
- 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 Settings
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Settings() {
const { profile } = useSelector(({ user }) => ({
...user,
}));
const dispatch = useDispatch();
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 }) => ({
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);
- 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 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
- 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 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();
- 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"