@@ -582,33 +582,55 @@ export class Application {
582
582
let cl :any = {
583
583
filePath : component . file ,
584
584
type : component . type ,
585
+ linktype : component . type ,
585
586
name : component . name
586
587
} ,
587
588
totalStatementDocumented = 0 ,
588
589
totalStatements = component . propertiesClass . length + component . methodsClass . length + component . inputsClass . length + component . outputsClass . length + 1 ; // +1 for component decorator comment
590
+
591
+ if ( component . constructorObj ) {
592
+ totalStatements += 1 ;
593
+ if ( component . constructorObj . description !== '' ) {
594
+ totalStatementDocumented += 1 ;
595
+ }
596
+ }
597
+ if ( component . description !== '' ) {
598
+ totalStatementDocumented += 1 ;
599
+ }
600
+
589
601
_ . forEach ( component . propertiesClass , ( property ) => {
590
- if ( property . description !== '' ) {
602
+ if ( property . modifierKind === 111 ) { // Doesn't handle private for coverage
603
+ totalStatements -= 1 ;
604
+ }
605
+ if ( property . description !== '' && property . modifierKind !== 111 ) {
591
606
totalStatementDocumented += 1 ;
592
607
}
593
608
} ) ;
594
609
_ . forEach ( component . methodsClass , ( method ) => {
595
- if ( method . description !== '' ) {
610
+ if ( method . modifierKind === 111 ) { // Doesn't handle private for coverage
611
+ totalStatements -= 1 ;
612
+ }
613
+ if ( method . description !== '' && method . modifierKind !== 111 ) {
596
614
totalStatementDocumented += 1 ;
597
615
}
598
616
} ) ;
599
617
_ . forEach ( component . inputsClass , ( input ) => {
600
- if ( input . description !== '' ) {
618
+ if ( input . modifierKind === 111 ) { // Doesn't handle private for coverage
619
+ totalStatements -= 1 ;
620
+ }
621
+ if ( input . description !== '' && input . modifierKind !== 111 ) {
601
622
totalStatementDocumented += 1 ;
602
623
}
603
624
} ) ;
604
625
_ . forEach ( component . outputsClass , ( output ) => {
605
- if ( output . description !== '' ) {
626
+ if ( output . modifierKind === 111 ) { // Doesn't handle private for coverage
627
+ totalStatements -= 1 ;
628
+ }
629
+ if ( output . description !== '' && output . modifierKind !== 111 ) {
606
630
totalStatementDocumented += 1 ;
607
631
}
608
632
} ) ;
609
- if ( component . description !== '' ) {
610
- totalStatementDocumented += 1 ;
611
- }
633
+
612
634
cl . coveragePercent = Math . floor ( ( totalStatementDocumented / totalStatements ) * 100 ) ;
613
635
if ( totalStatements === 0 ) {
614
636
cl . coveragePercent = 0 ;
@@ -626,20 +648,39 @@ export class Application {
626
648
let cl :any = {
627
649
filePath : classe . file ,
628
650
type : 'class' ,
651
+ linktype : 'classe' ,
629
652
name : classe . name
630
653
} ,
631
654
totalStatementDocumented = 0 ,
632
- totalStatements = classe . properties . length + classe . methods . length ;
655
+ totalStatements = classe . properties . length + classe . methods . length + 1 ; // +1 for class itself
656
+
657
+ if ( classe . constructorObj ) {
658
+ totalStatements += 1 ;
659
+ if ( classe . constructorObj . description !== '' ) {
660
+ totalStatementDocumented += 1 ;
661
+ }
662
+ }
663
+ if ( classe . description !== '' ) {
664
+ totalStatementDocumented += 1 ;
665
+ }
666
+
633
667
_ . forEach ( classe . properties , ( property ) => {
634
- if ( property . description !== '' ) {
668
+ if ( property . modifierKind === 111 ) { // Doesn't handle private for coverage
669
+ totalStatements -= 1 ;
670
+ }
671
+ if ( property . description !== '' && property . modifierKind !== 111 ) {
635
672
totalStatementDocumented += 1 ;
636
673
}
637
674
} ) ;
638
675
_ . forEach ( classe . methods , ( method ) => {
639
- if ( method . description !== '' ) {
676
+ if ( method . modifierKind === 111 ) { // Doesn't handle private for coverage
677
+ totalStatements -= 1 ;
678
+ }
679
+ if ( method . description !== '' && method . modifierKind !== 111 ) {
640
680
totalStatementDocumented += 1 ;
641
681
}
642
682
} ) ;
683
+
643
684
cl . coveragePercent = Math . floor ( ( totalStatementDocumented / totalStatements ) * 100 ) ;
644
685
if ( totalStatements === 0 ) {
645
686
cl . coveragePercent = 0 ;
@@ -657,20 +698,39 @@ export class Application {
657
698
let cl :any = {
658
699
filePath : injectable . file ,
659
700
type : injectable . type ,
701
+ linktype : injectable . type ,
660
702
name : injectable . name
661
703
} ,
662
704
totalStatementDocumented = 0 ,
663
- totalStatements = injectable . properties . length + injectable . methods . length ;
705
+ totalStatements = injectable . properties . length + injectable . methods . length + 1 ; // +1 for injectable itself
706
+
707
+ if ( injectable . constructorObj ) {
708
+ totalStatements += 1 ;
709
+ if ( injectable . constructorObj . description !== '' ) {
710
+ totalStatementDocumented += 1 ;
711
+ }
712
+ }
713
+ if ( injectable . description !== '' ) {
714
+ totalStatementDocumented += 1 ;
715
+ }
716
+
664
717
_ . forEach ( injectable . properties , ( property ) => {
665
- if ( property . description !== '' ) {
718
+ if ( property . modifierKind === 111 ) { // Doesn't handle private for coverage
719
+ totalStatements -= 1 ;
720
+ }
721
+ if ( property . description !== '' && property . modifierKind !== 111 ) {
666
722
totalStatementDocumented += 1 ;
667
723
}
668
724
} ) ;
669
725
_ . forEach ( injectable . methods , ( method ) => {
670
- if ( method . description !== '' ) {
726
+ if ( method . modifierKind === 111 ) { // Doesn't handle private for coverage
727
+ totalStatements -= 1 ;
728
+ }
729
+ if ( method . description !== '' && method . modifierKind !== 111 ) {
671
730
totalStatementDocumented += 1 ;
672
731
}
673
732
} ) ;
733
+
674
734
cl . coveragePercent = Math . floor ( ( totalStatementDocumented / totalStatements ) * 100 ) ;
675
735
if ( totalStatements === 0 ) {
676
736
cl . coveragePercent = 0 ;
@@ -688,20 +748,39 @@ export class Application {
688
748
let cl :any = {
689
749
filePath : inter . file ,
690
750
type : inter . type ,
751
+ linktype : inter . type ,
691
752
name : inter . name
692
753
} ,
693
754
totalStatementDocumented = 0 ,
694
- totalStatements = inter . properties . length + inter . methods . length ;
755
+ totalStatements = inter . properties . length + inter . methods . length + 1 ; // +1 for interface itself
756
+
757
+ if ( inter . constructorObj ) {
758
+ totalStatements += 1 ;
759
+ if ( inter . constructorObj . description !== '' ) {
760
+ totalStatementDocumented += 1 ;
761
+ }
762
+ }
763
+ if ( inter . description !== '' ) {
764
+ totalStatementDocumented += 1 ;
765
+ }
766
+
695
767
_ . forEach ( inter . properties , ( property ) => {
696
- if ( property . description !== '' ) {
768
+ if ( property . modifierKind === 111 ) { // Doesn't handle private for coverage
769
+ totalStatements -= 1 ;
770
+ }
771
+ if ( property . description !== '' && property . modifierKind !== 111 ) {
697
772
totalStatementDocumented += 1 ;
698
773
}
699
774
} ) ;
700
775
_ . forEach ( inter . methods , ( method ) => {
701
- if ( method . description !== '' ) {
776
+ if ( method . modifierKind === 111 ) { // Doesn't handle private for coverage
777
+ totalStatements -= 1 ;
778
+ }
779
+ if ( method . description !== '' && method . modifierKind !== 111 ) {
702
780
totalStatementDocumented += 1 ;
703
781
}
704
782
} ) ;
783
+
705
784
cl . coveragePercent = Math . floor ( ( totalStatementDocumented / totalStatements ) * 100 ) ;
706
785
if ( totalStatements === 0 ) {
707
786
cl . coveragePercent = 0 ;
@@ -715,13 +794,15 @@ export class Application {
715
794
let cl :any = {
716
795
filePath : pipe . file ,
717
796
type : pipe . type ,
797
+ linktype : pipe . type ,
718
798
name : pipe . name
719
799
} ,
720
800
totalStatementDocumented = 0 ,
721
801
totalStatements = 1 ;
722
802
if ( pipe . description !== '' ) {
723
803
totalStatementDocumented += 1 ;
724
804
}
805
+
725
806
cl . coveragePercent = Math . floor ( ( totalStatementDocumented / totalStatements ) * 100 ) ;
726
807
cl . coverageCount = totalStatementDocumented + '/' + totalStatements ;
727
808
cl . status = getStatus ( cl . coveragePercent ) ;
0 commit comments