MCPcopy Create free account
hub / github.com/code-pushup/cli / transformGQLIssue

Function transformGQLIssue

packages/ci/src/lib/portal/transform.ts:146–181  ·  view source on GitHub ↗
(issue: IssueFragment)

Source from the content-addressed store, hash-verified

144}
145
146function transformGQLIssue(issue: IssueFragment): Issue {
147 return {
148 message: issue.message,
149 severity: lowercase(issue.severity),
150 ...(issue.source?.__typename === 'SourceCodeLocation' && {
151 source: {
152 file: issue.source.filePath,
153 ...(issue.source.startLine != null && {
154 position: {
155 startLine: issue.source.startLine,
156 ...(issue.source.startColumn != null && {
157 startColumn: issue.source.startColumn,
158 }),
159 ...(issue.source.endLine != null && {
160 endLine: issue.source.endLine,
161 }),
162 ...(issue.source.endColumn != null && {
163 endColumn: issue.source.endColumn,
164 }),
165 },
166 }),
167 },
168 }),
169 ...(issue.source?.__typename === 'SourceUrlLocation' && {
170 source: {
171 url: issue.source.url,
172 ...(issue.source.snippet != null && {
173 snippet: issue.source.snippet,
174 }),
175 ...(issue.source.selector != null && {
176 selector: issue.source.selector,
177 }),
178 },
179 }),
180 };
181}
182
183function transformGQLTable(table: TableFragment): Table {
184 if (!table.header) {

Callers

nothing calls this directly

Calls 1

lowercaseFunction · 0.90

Tested by

no test coverage detected