Compodoc Documentation Coverage Statement Numbers Meaning (1/3, 1/2, etc...)

1.7k Views Asked by At

I am using compodoc for an Angular app and using the Documentation Coverage to ensure I am fully documenting the app. When the Statement value is 0/3 or 1/2, how do I determine what documentation is missing from the /**... comments in the code/file?

Example - For my User Component my comment is:

/**
 * Users Component
 *
 * @export
 * @class UsersComponent
 * @implements {OnInit}
 */

@Component({
    selector: 'fcp-users',
    templateUrl: './users.component.html',
    styleUrls: ['./users.component.scss'],
})
export class UsersComponent implements OnInit {
    constructor() {}

    ngOnInit(): void {}
}

The Documentation Coverage Statement for that file states (33% 1/3). What are the missing 2/3s? How do I determine what documentation is required for components, injectables, etc???

1

There are 1 best solutions below

1
On BEST ANSWER

The missing 2/3's are, seems like, the two methods in your class: constructor() and ngOnInit(). If you add documentation around those, your documentation coverage for that class should get to 100%.

In general, you would like to document the followings for your classes (which includes services, components and any other classes):

  • The class itself (like you did)
  • Public methods (including the constructor and ngOnInit)
  • Public properties

Here are some examples with documentation:

100% coverage (9/9): https://compodoc.github.io/compodoc-demo-todomvc-angular/components/FooterComponent.html

83% coverage (5/6): https://compodoc.github.io/compodoc-demo-todomvc-angular/components/HeaderComponent.html