GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — codeql/swift/ql/src/AlertSuppression.ql at codeql-cli/v2.24.0 · github/codeql Expand file tree/ Copy pathAlertSuppression.qlMore file actions 45 lines (38 loc) · 1.45 KB / Copy pathAlertSuppression.qlFile metadata and controls45 lines (38 loc) · 1.45 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 /** * @name Alert suppression * @description Generates information about alert suppressions. * @kind alert-suppression * @id swift/alert-suppression */ private import codeql.util.suppression.AlertSuppression as AS private import codeql.swift.elements.Locatable as L private import codeql.swift.elements.Comments as C class AstNode extends L::Locatable { predicate hasLocationInfo(string path, int startLine, int startColumn, int endLine, int endColumn) { this.getLocation().hasLocationInfo(path, startLine, startColumn, endLine, endColumn) } } class SingleLineComment extends AstNode instanceof C::Comment { private string text; SingleLineComment() { this instanceof C::SingleLineComment and text = super.getText().regexpCapture("//([^\\r\\n]*)[\\r\\n]?", 1) or this instanceof C::MultiLineComment and // suppression comments must be single-line text = super.getText().regexpCapture("/\\*([^\\r\\n]*)\\*/", 1) } override predicate hasLocationInfo( string path, int startLine, int startColumn, int endLine, int endColumn ) { this.(C::SingleLineComment).getLocation().hasLocationInfo(path, startLine, startColumn, _, _) and endLine = startLine and endColumn = startColumn + text.length() + 1 or this.(C::MultiLineComment) .getLocation() .hasLocationInfo(path, startLine, startColumn, endLine, endColumn + 1) } string getText() { result = text } } import AS::Make<AstNode, SingleLineComment> |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |