• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rokucommunity / brighterscript / #15903

11 May 2026 06:41PM UTC coverage: 86.896% (-2.2%) from 89.094%
#15903

push

web-flow
Merge 70dfd6181 into ce68f5cb7

15597 of 18958 branches covered (82.27%)

Branch coverage included in aggregate %.

9 of 9 new or added lines in 3 files covered. (100.0%)

955 existing lines in 53 files now uncovered.

16351 of 17808 relevant lines covered (91.82%)

27326.16 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.2
/src/bscPlugin/validation/XmlFileValidator.ts
1
import { DiagnosticMessages } from '../../DiagnosticMessages';
1✔
2
import type { XmlFile } from '../../files/XmlFile';
3
import type { ValidateFileEvent } from '../../interfaces';
4
import type { SGAst } from '../../parser/SGTypes';
5
import util from '../../util';
1✔
6

7
export class XmlFileValidator {
1✔
8
    constructor(
9
        public event: ValidateFileEvent<XmlFile>
474✔
10
    ) {
11
    }
12

13
    public process() {
14
        util.validateTooDeepFile(this.event.file);
474✔
15
        if (this.event.file.parser.ast.rootElement) {
474✔
16
            this.validateComponent(this.event.file.parser.ast);
473✔
17
        } else {
18
            //skip empty XML
19
        }
20
    }
21

22
    private validateComponent(ast: SGAst) {
23
        const { rootElement, componentElement } = ast;
473✔
24
        if (!componentElement) {
473✔
25
            //not a SG component
26
            this.event.program.diagnostics.register({
1✔
27
                ...DiagnosticMessages.xmlComponentMissingComponentDeclaration(),
28
                location: rootElement.location
29
            });
30
            return;
1✔
31
        }
32

33
        //component name/extends
34
        if (!componentElement.name) {
472✔
35
            this.event.program.diagnostics.register({
5✔
36
                ...DiagnosticMessages.xmlComponentMissingNameAttribute(),
37
                location: componentElement.tokens.startTagName.location
38
            });
39
        }
40
        if (!componentElement.extends) {
472✔
41
            this.event.program.diagnostics.register({
37✔
42
                ...DiagnosticMessages.xmlComponentMissingExtendsAttribute(),
43
                location: componentElement.tokens.startTagName.location
44
            });
45
        }
46

47
        //flag explicit script imports that match the auto-imported codebehind file
48
        const file = this.event.file;
472✔
49
        if (file.program?.options?.autoImportComponentScript === true) {
472!
50
            const codebehindPaths = file.possibleCodebehindDestPaths ?? [];
159!
51
            for (const scriptImport of file.parser.references.scriptTagImports) {
159✔
52
                if (!scriptImport.destPath || !scriptImport.filePathRange) {
25!
UNCOV
53
                    continue;
×
54
                }
55
                if (codebehindPaths.includes(scriptImport.destPath)) {
25✔
56
                    this.event.program.diagnostics.register({
5✔
57
                        ...DiagnosticMessages.unnecessaryCodebehindScriptImport(),
58
                        location: util.createLocationFromFileRange(file, scriptImport.filePathRange)
59
                    });
60
                }
61
            }
62
        }
63
    }
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc