reportWebVitals
1const reportWebVitals = onPerfEntry => { 2 if (onPerfEntry && onPerfEntry instanceof Function) {
3 import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 getCLS(onPerfEntry);
ViewSSHKeypair
15import { IoClipboard } from "react-icons/io5";
16import { fetchData } from "../utils/fetchData";
17
18const ViewSSHKeypair = () => { 19 const { id } = useParams();
20 const [pubKey, setPubKey] = useState();
21 const [privKey, setPrivKey] = useState();
fetchKeypair
23 const [hasCopiedPubKey, setHasCopiedPubKey] = useState(false);
24
25 useEffect(() => {
26 const fetchKeypair = async () => { 27 try {
28 const url = `http://127.0.0.1:8080/api/v1/key/${id}`;
29 const options = { withCredentials: true };
fetchKeypairs
26
27// Dashboard page
28const Dashboard = () => {
29 const fetchKeypairs = async () => {30 try {
31 const options = { withCredentials: true };
32 const response = await fetchData(
renderAlert
34 error: useRef(false),
35 };
36
37 const renderAlert = () => { 38 if (status.success.current === true) {
39 return (
40 <Alert status="success">
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;
}