handleTouchEnd
112 setActiveIndex(index);
113 };
114
115 const handleTouchEnd = () => {116 setActiveIndex(null);
117 };
118
handleTouchStart
108
109 const [activeIndex, setActiveIndex] = useState(null);
110
111 const handleTouchStart = (index) => {112 setActiveIndex(index);
113 };
114
Dashboard
15import { ThemeContext } from '../../App';
16import { Switch } from 'antd';
17
18const Dashboard = () => { 19 const navigate = useNavigate();
20 const location = useLocation();
21 const [menuOpen, setMenuOpen] = useState(false);
Login
17import { Switch } from 'antd';
18import { ThemeContext } from "../../App";
19
20export default function Login() { 21 const [error, setError] = useState({});
22 const [passwordType, setPasswordType] = useState("password");
23 const [captchaVal, setCaptchaVal] = useState("");
handleImageUpload
69 });
70 };
71
72 const handleImageUpload = (e) => { 73 const file = e.target.files[0];
74 const reader = new FileReader();
75 reader.onloadend = () => {
It is recommended to have documentation comments above, or right inside a function/class declaration. This helps developers, users and even the author understand the purpose of a code snippet or API function in the future.
NOTE: If you want to stop this issue from getting raised on certain constructs (arrow functions, class expressions, methods etc.), consider using the skipdoccoverage option under the analyzers.meta
property in your .deepsource.toml
file.
For example, the following configuration will silence this issue for class expressions and method definitions:
[analyzers.meta]
skip_doc_coverage = ["class-expression", "method-definition"]
function sum(a, b) {
return a + b;
}
/**
* Function to add two numbers
* @param a The first number to add
* @param b The second number to add
* @returns The sum of two numbers
*/
function sum(a, b) {
return a + b;
}