Skip to content

Commit

Permalink
Fix remaining CodeQL reports (#28142)
Browse files Browse the repository at this point in the history
  • Loading branch information
pomahtri authored Oct 17, 2024
1 parent 39a1065 commit f795096
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 86 deletions.
38 changes: 0 additions & 38 deletions apps/demos/utils/interactive/link-repos.js

This file was deleted.

43 changes: 0 additions & 43 deletions apps/demos/utils/interactive/repos-helper.js

This file was deleted.

8 changes: 6 additions & 2 deletions packages/devextreme-monorepo-tools/src/version-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ export function validateVersion(version: string | undefined): string {
}

export function formatVersion(version: string | undefined): string | undefined {
if (version?.length && version.length > 1000) {
if (version === undefined) {
return undefined;
}

if (version.length > 1000) {
throw new Error("version string is too long");
}

return version?.match(/(\d+\.\d+\.\d+)(\D|$)/)?.[1];
return version.match(/(\d+\.\d+\.\d+)(\D|$)/)?.[1];
}

const MSECS_IN_MIN = 1000 * 60;
Expand Down
8 changes: 5 additions & 3 deletions packages/devextreme/testing/helpers/vectormaputils-tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ function getRequestInfo(url) {

require('http').createServer(function(request, response) {
const info = getRequestInfo(request.url);
const action = actions[info.action];
response.writeHead(200, { 'Content-Type': 'text/plain' });
if(action && typeof action === 'function') {
action(info.arg, callback);
if(Object.hasOwn(actions, info.action)) {
const action = actions[info.action];
if(typeof action === 'function') {
action(info.arg, callback);
}
}
function callback(data) {
response.end(JSON.stringify(data));
Expand Down

0 comments on commit f795096

Please sign in to comment.