Showing 35 of 84 total issues
Function itemsReducer
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const itemsReducer = (state = initialState, action) => {
switch (action.type) {
case SET_ITEMS:
return {
...state,
- 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 render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render() {
let headingText = null;
let confirmPasswordControl = 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"
Further reading
Function TestInput
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TestInput = (props) => {
let textInput = <TextInput
data-test="container1"
style={styles.input}
{...props}
Function SupplierContactScreen
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SupplierContactScreen = props => {
const dialCall = () => {
let phoneNumber = '';
Function ManageItemScreen
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ManageItemScreen = props => {
const availableItems = useSelector(state => state.items.items);
const [text, settext] = useState('');
const [dataSource, setdataSource] = useState('');
Function ItemList
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ItemList = props => {
const renderInventoryItem = itemData => {
return (
Function signUp
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const signUp = (email, password) => {
// console.log("authentication", email, password)
return async dispatch => {
const data = {
Function AddScreen
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const AddScreen = props => {
const selectedItem = useSelector(state =>
state.items.items
);
- 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 login
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const login = (email, password) => {
return async (dispatch, getState) => {
const data = {
username: email,
Function deleteHandler
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const deleteHandler = useCallback(() => {
let action =
itemsActions.deleteItem(
itemId
)
Function ItemCategoryScreen
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ItemCategoryScreen = props => {
const dispatch = useDispatch();
// useEffect(() => {
// dispatch(itemsActions.setItems())
// }, [])
Function SendScreen
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const SendScreen = props => {
const [time, showTime] = useState(false);
const [date, showDate] = useState(false);
const[ newDate,setDate]= useState(new Date());
let options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' , hour: "2-digit", minute: "2-digit" };
- 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 state;
Function ItemListScreen
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ItemListScreen = props => {
const catTitle = props.navigation.getParam('title');
const [text, settext] = useState('');
const [dataSource, setdataSource] = 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 signUp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const signUp = (email, password) => {
// console.log("authentication", email, password)
return async dispatch => {
const data = {
- 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"