internCard
77
78};
79
80const internCard = ({ name, id, email, school }) => { 81 return `
82 <div class="cell flex-container">
83 <div class="card">
engineerCard
41 `;
42};
43
44const engineerCard = ({ name, id, email, github }) => { 45
46 return `
47 <div class="cell flex-container">
generateDocument
27 return item;
28}
29
30function generateDocument(data) { 31
32 var html = generateHTML(data);
33
Manager
12 *
13 */
14const Employee = require('./Employee');
15class Manager extends Employee {16 constructor(name, id, email, officeNumber) {
17
18 if (typeof officeNumber !== "number" || isNaN(officeNumber) || officeNumber < 0) {
getOfficeNumber
22 this.officeNumber = officeNumber;
23 }
24
25 getOfficeNumber() {26 return this.officeNumber;
27 }
28
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;
}