Documentation comment not found for class
Product
2import productRegisterSchema from '../validators/product.schema.js';
3import { ProductRepository } from './repository.js';
4
5class Product extends Entity { 6 constructor() {
7 super(productRegisterSchema , ProductRepository)
8 }
Documentation comment not found for class
Order
2import orderRegisterSchema from '../validators/order.schema.js';
3import { OrderRepository } from './repository.js';
4
5class Order extends Entity { 6 constructor() {
7 super(orderRegisterSchema , OrderRepository)
8 }
Documentation comment not found for method definition
sayHi
6 constructor(){
7 super(TestController, entity)
8 }
9 static async sayHi(){10 try{
11 return entity.sayHello()
12 }
Documentation comment not found for class
TestController
2import Controller from "./controller.js";
3const entity = new TestEntity()
4
5class TestController extends Controller{ 6 constructor(){
7 super(TestController, entity)
8 }
Documentation comment not found for method definition
update
38 }
39 }
40
41 async update(req, res){42 try{
43 await this.model.update(req.params.id, req.body)
44 return res.json({ msg: `Se ha actualizado el ${Object.getPrototypeOf(this)} exitosamente` })
Documentation comment not found for method definition
findById
28 }
29 }
30
31 async findById(req, res){32 try{
33 const result = await this.model.findOne(req.params.id)
34 return res.json({ msg: `Se encontró el siguiente ${Object.getPrototypeOf(this)}`, data: result })
Documentation comment not found for method definition
find
18 }
19 }
20
21 async find(req, res){22 try{
23 const results = await this.model.findmany()
24 return res.json({ msg: `Se encontraron los siguientes resultados`, data: results })
Documentation comment not found for method definition
create
8 this.model = model
9 }
10
11 async create(req, res){12 try{
13 await this.model.create(req.body)
14 return res.json({ msg: `El ${Object.getPrototypeOf(this)} ha sido creado con exito!` })
Documentation comment not found for class
Controller
1export default class Controller { 2 constructor(controller, model) {
3 if (new.target === Controller) {
4 throw new Error('5: Cannot create an instance of Controller because it is an abstract class');
Documentation comment not found for class
clientController
2import Controller from './controller.js'
3const modeloCliente = new ClientModel()
4
5class clientController extends Controller{ 6
7 constructor(){
8 super(clientController, modeloCliente)
Description
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"]
Bad Practice
function sum(a, b) {
return a + b;
}
Recommended
/**
* 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;
}