Skip to content

Implement data fetching from baseURL#207

Open
anto-deepsource wants to merge 1 commit intomasterfrom
anto-deepsource-patch-1
Open

Implement data fetching from baseURL#207
anto-deepsource wants to merge 1 commit intomasterfrom
anto-deepsource-patch-1

Conversation

@anto-deepsource
Copy link
Contributor

Added a request to fetch data from baseURL and log the response.

Added a request to fetch data from baseURL and log the response.

Signed-off-by: Anto Christopher <93177734+anto-deepsource@users.noreply.github.com>
@deepsource-development
Copy link

deepsource-development bot commented Feb 12, 2026

DeepSource Code Review

DeepSource reviewed changes in the commit range 1120e57..ce05206 on this pull request. Below is the summary for the review, and you can see the individual issues we found as review comments.

For detailed review results, please see the PR on DeepSource ↗

PR Report Card

Security × 1 issue Overall PR Quality   

Focus Area: Reliability

Guidance
Fix the critical issue of the `const` variable `ExpectedCapitals` being redeclared in javascript/index.js.

Grade capped at C due to critical security issue
Reliability × 2 issues
Complexity × 0 issues
Hygiene × 0 issues

Code Review Summary

Analyzer Status Summary Details
Go No new issues detected. Review ↗
Python No new issues detected. Review ↗
SQL No new issues detected. Review ↗
Terraform No new issues detected. Review ↗
JavaScript 3 new issues detected. 21 existing issues fixed. Review ↗
Secrets No new issues detected. Review ↗
How are these analyzer statuses calculated?

Administrators can configure which issue categories are reported and cause analysis to be marked as failed when detected. This helps prevent bad and insecure code from being introduced in the codebase. If you're an administrator, you can modify this in the repository's settings.


💡 If you're a repository administrator, you can configure the quality gates from the settings.

India: "Delhi", // <- duplicate key
};

request(baseURL, (error, response, body) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecated `request` library has unpatched vulnerabilities


The request library was deprecated in February 2020 and is no longer maintained. Using it exposes the application to unpatched security vulnerabilities, such as improper handling of redirects which can lead to Server-Side Request Forgery (SSRF) if the URL is compromised.

Replace request with a modern, maintained library like axios or node-fetch to ensure continued security support and prevent exposure to known exploits.

Comment on lines +35 to +41
const ExpectedCapitals = {
India: "New Delhi",
USA: "WDC",
Nepal: "Kathmandu",
China: "Beijing",
India: "Delhi", // <- duplicate key
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`const` variable `ExpectedCapitals` is redeclared


The const variable ExpectedCapitals is declared twice in the same scope. This is not allowed in JavaScript and will raise a `SyntaxError: Identifier 'ExpectedCapitals' has already been declared', which will crash the application on startup.

Remove the duplicate declaration of ExpectedCapitals to resolve the syntax error and ensure the program can run.

Comment on lines +36 to +40
India: "New Delhi",
USA: "WDC",
Nepal: "Kathmandu",
China: "Beijing",
India: "Delhi", // <- duplicate key

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate key `India` in object literal overwrites value


The object ExpectedCapitals contains a duplicate key India. In JavaScript, subsequent keys with the same name overwrite previous ones, so the value &quot;New Delhi&quot; will be silently discarded and India will be assigned &quot;Delhi&quot;. This can lead to unexpected behavior and logic errors.

Remove or rename the duplicate India key to ensure all data is preserved as intended and to prevent incorrect logic based on the object's values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant