Showing 43 of 187 total issues
Function Footer
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Footer() {
return (
<footer className="landing-footer-container">
<div>
<section>
Function ReactionButton
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const ReactionButton = ({ reactions, rec_id, id, open, inModal }) => {
const dispatch = useDispatch();
// checks whether the current logged in user is among those who liekd the post
const userReaction = useMemo(() => {
- 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 ProfileTeamList
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function ProfileTeamList({ myProfile }) {
const [modal, setModal] = useState(false);
const [teamDetails, setTeamDetails] = useState();
const [loadingState] = useState();
const [organizationMembers, setOrganizationMembers] = 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"
Further reading
Function Nav
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Nav() {
const [open, setOpen] = React.useState(false);
return (
<nav className="nav">
<a
Function liveFeedListeners
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const liveFeedListeners = sse => dispatch => {
// Listening for NEW events
sse.addEventListener(FEED_EVENT_NEW_REC, event =>
dispatch({
type: FEED_EVENT_NEW_REC,
Function UserUpload
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function UserUpload() {
const [user] = useState({
first_name: '',
last_name: '',
email: '',
Function orgReducer
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const orgReducer = (state = initialState, action) => {
switch (action.type) {
case ORG_UPDATE_LOGO_START:
return {
...state,
Function DropDown
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const DropDown = ({
children,
setSelection,
id,
placeholder,
- 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 getCroppedImg
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getCroppedImg = (image, crop, fileName) => {
const canvas = document.createElement('canvas');
const scaleX = image.naturalWidth / image.width;
const scaleY = image.naturalHeight / image.height;
canvas.width = crop.width;
Function timeAgo
has 30 lines of code (exceeds 25 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()
Function LeadershipBoard
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function LeadershipBoard(props) {
const [rank, setRank] = useState([]);
const [count, setCount] = useState(0);
const [limit, setLimit] = useState(5);
Function S1GetStarted
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function S1GetStarted() {
return (
<div data-test="S1Component">
<h1>Getting Started</h1>
<h5>You're only a few steps away from getting started on Kansha</h5>
Function CommentButton
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const CommentButton = ({
comments,
id,
open,
handleComment,
- 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 OrgEmployees
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const OrgEmployees = ({
employee,
empButton,
addTeamMember,
id,
- 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
Avoid too many return
statements within this function. Open
return `${time} week${time > 1 ? 's' : ''} ago`;
Avoid too many return
statements within this function. Open
return `${time} month${time > 1 ? 's' : ''} ago`;
Avoid too many return
statements within this function. Open
return `${time} year${time > 1 ? 's' : ''} ago`;
Function App
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const App = () => {
const [init, setInit] = useState({
fetched: false,
error: false,
onboarding: 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 S4AUserUpload
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function S4AUserUpload() {
const [uploadNow, setUploadNow] = useState('');
const [uploadMethod, setUploadMethod] = useState('');
let history = useHistory();
- 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 S4CUserUpload
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function S4CUserUpload({ user }) {
let history = useHistory();
const [error, setError] = useState('');
const [file, setFile] = useState(null);
- 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"