question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

False positive: ini

See original GitHub issue

Bug Description

ini is listed a false positive (along with https-proxy-agent). I think this might be a duplicate of #585 (see the errors below in json-output).

Code snippets

Where the dependency is used:

readConfigFile.ts

import * as ini from 'ini';
# ...
return <T> ini.parse(fs.readFileSync(path.join(folderPath, fileName), 'utf-8'));

Versions

  • node -v: v14.13.1
  • npm -v: 6.14.8
  • depcheck --version: 1.3.1

Extra info

steps to reproduce:

git clone https://github.com/nils-a/cake-vscode.git
cd cake-vscode
git checkout feature/cleanup-deps
npm i
npm run depcheck

depcheck --json:

{
    "dependencies": [
        "https-proxy-agent",
        "ini"
    ],
    "devDependencies": [
        "@types/ini"
    ],
    "missing": {},
    "using": {
        "depcheck": [
            "D:\\_dev\\cake-vscode\\package.json"
        ],
        "typescript": [
            "D:\\_dev\\cake-vscode\\package.json"
        ],
        "@types/node": [
            "D:\\_dev\\cake-vscode\\test\\index.ts",
            "D:\\_dev\\cake-vscode\\test\\runTest.ts",
            "D:\\_dev\\cake-vscode\\test\\shared\\utils\\handlePackagesConfig.test.ts",
            "D:\\_dev\\cake-vscode\\test\\codeLens\\codeLens.test.ts",
            "D:\\_dev\\cake-vscode\\test\\bootstrapper\\bootstrapper.test.ts",
            "D:\\_dev\\cake-vscode\\test\\bootstrapper\\memorystream.ts",
            "D:\\_dev\\cake-vscode\\src\\cakeMain.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\checkForExisting.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\getFilesPath.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\handleWriteFile.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\terminalExecutor.ts",
            "D:\\_dev\\cake-vscode\\src\\debug\\cakeDebug.ts",
            "D:\\_dev\\cake-vscode\\src\\debug\\cakeDebugCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\configuration\\cakeConfiguration.ts",
            "D:\\_dev\\cake-vscode\\src\\configuration\\cakeConfigurationCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\codeLens\\cakeRunTaskCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\buildFile\\cakeBuildFile.ts",
            "D:\\_dev\\cake-vscode\\src\\bootstrapper\\cakeBootstrapper.ts",
            "D:\\_dev\\cake-vscode\\src\\bootstrapper\\cakeBootstrapperCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\bakery\\cakeBakery.ts",
            "D:\\_dev\\cake-vscode\\src\\bakery\\cakeBakeryCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\fetchCakePackages.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\handleDirectiveWithContent.ts"
        ],
        "mocha": [
            "D:\\_dev\\cake-vscode\\test\\index.ts"
        ],
        "@types/mocha": [
            "D:\\_dev\\cake-vscode\\test\\index.ts"
        ],
        "glob": [
            "D:\\_dev\\cake-vscode\\test\\index.ts"
        ],
        "@types/glob": [
            "D:\\_dev\\cake-vscode\\test\\index.ts"
        ],
        "vscode-test": [
            "D:\\_dev\\cake-vscode\\test\\runTest.ts"
        ],
        "typemoq": [
            "D:\\_dev\\cake-vscode\\test\\codeLens\\codeLens.test.ts"
        ],
        "vscode": [
            "D:\\_dev\\cake-vscode\\test\\codeLens\\codeLens.test.ts",
            "D:\\_dev\\cake-vscode\\src\\cakeMain.ts",
            "D:\\_dev\\cake-vscode\\src\\extensionSettings.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\log.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\checkForExisting.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\handleWriteFile.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\index.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\showFileQuickPick.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\terminalExecutor.ts",
            "D:\\_dev\\cake-vscode\\src\\install\\cakeInstallCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\install\\actions\\index.ts",
            "D:\\_dev\\cake-vscode\\src\\install\\actions\\installCake.ts",
            "D:\\_dev\\cake-vscode\\src\\documentSymbols\\cakeDocumentSymbolProvider.ts",
            "D:\\_dev\\cake-vscode\\src\\debug\\cakeDebug.ts",
            "D:\\_dev\\cake-vscode\\src\\debug\\cakeDebugCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\configuration\\cakeConfiguration.ts",
            "D:\\_dev\\cake-vscode\\src\\configuration\\cakeConfigurationCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\codeLens\\cakeCodeLensProvider.ts",
            "D:\\_dev\\cake-vscode\\src\\codeLens\\cakeDebugTask.ts",
            "D:\\_dev\\cake-vscode\\src\\codeLens\\cakeRunTaskCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\codeLens\\editorTools.ts",
            "D:\\_dev\\cake-vscode\\src\\buildFile\\cakeBuildFile.ts",
            "D:\\_dev\\cake-vscode\\src\\buildFile\\cakeBuildFileCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\bootstrapper\\cakeBootstrapper.ts",
            "D:\\_dev\\cake-vscode\\src\\bootstrapper\\cakeBootstrapperCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\bakery\\cakeBakery.ts",
            "D:\\_dev\\cake-vscode\\src\\bakery\\cakeBakeryCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\fetchCakePackages.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\fetchPackageVersions.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\handleDirectiveWithContent.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\handleErrorMessage.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\showPackageQuickPick.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\showPackageSearchBox.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\showVersionsQuickPick.ts"
        ],
        "@types/vscode": [
            "D:\\_dev\\cake-vscode\\test\\codeLens\\codeLens.test.ts",
            "D:\\_dev\\cake-vscode\\src\\cakeMain.ts",
            "D:\\_dev\\cake-vscode\\src\\extensionSettings.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\log.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\checkForExisting.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\handleWriteFile.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\index.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\showFileQuickPick.ts",
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\terminalExecutor.ts",
            "D:\\_dev\\cake-vscode\\src\\install\\cakeInstallCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\install\\actions\\index.ts",
            "D:\\_dev\\cake-vscode\\src\\install\\actions\\installCake.ts",
            "D:\\_dev\\cake-vscode\\src\\documentSymbols\\cakeDocumentSymbolProvider.ts",
            "D:\\_dev\\cake-vscode\\src\\debug\\cakeDebug.ts",
            "D:\\_dev\\cake-vscode\\src\\debug\\cakeDebugCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\configuration\\cakeConfiguration.ts",
            "D:\\_dev\\cake-vscode\\src\\configuration\\cakeConfigurationCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\codeLens\\cakeCodeLensProvider.ts",
            "D:\\_dev\\cake-vscode\\src\\codeLens\\cakeDebugTask.ts",
            "D:\\_dev\\cake-vscode\\src\\codeLens\\cakeRunTaskCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\codeLens\\editorTools.ts",
            "D:\\_dev\\cake-vscode\\src\\buildFile\\cakeBuildFile.ts",
            "D:\\_dev\\cake-vscode\\src\\buildFile\\cakeBuildFileCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\bootstrapper\\cakeBootstrapper.ts",
            "D:\\_dev\\cake-vscode\\src\\bootstrapper\\cakeBootstrapperCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\bakery\\cakeBakery.ts",
            "D:\\_dev\\cake-vscode\\src\\bakery\\cakeBakeryCommand.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\fetchCakePackages.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\fetchPackageVersions.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\handleDirectiveWithContent.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\handleErrorMessage.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\showPackageQuickPick.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\showPackageSearchBox.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\showVersionsQuickPick.ts"
        ],
        "xml2js": [
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\handlePackagesConfig.ts"
        ],
        "@types/xml2js": [
            "D:\\_dev\\cake-vscode\\src\\shared\\utils\\handlePackagesConfig.ts"
        ],
        "request": [
            "D:\\_dev\\cake-vscode\\src\\debug\\cakeDebug.ts",
            "D:\\_dev\\cake-vscode\\src\\configuration\\cakeConfiguration.ts",
            "D:\\_dev\\cake-vscode\\src\\bootstrapper\\cakeBootstrapper.ts",
            "D:\\_dev\\cake-vscode\\src\\bakery\\cakeBakery.ts"
        ],
        "adm-zip": [
            "D:\\_dev\\cake-vscode\\src\\debug\\cakeDebug.ts",
            "D:\\_dev\\cake-vscode\\src\\bakery\\cakeBakery.ts"
        ],
        "node-fetch": [
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\fetchCakePackages.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\fetchPackageVersions.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\handleSearchResponse.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\handleVersionsResponse.ts"
        ],
        "@types/node-fetch": [
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\fetchCakePackages.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\fetchPackageVersions.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\handleSearchResponse.ts",
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\handleVersionsResponse.ts"
        ],
        "byline": [
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\handleDirectiveWithContent.ts"
        ],
        "@types/byline": [
            "D:\\_dev\\cake-vscode\\src\\addPackage\\actions\\handleDirectiveWithContent.ts"
        ]
    },
    "invalidFiles": {
        "D:\\_dev\\cake-vscode\\test\\addPackage\\actions\\handleSearchResponse.test.ts": "SyntaxError: Unexpected token, expected \"}\" (8:64)\n    at Object._raise (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:748:17)\n    at Object.raiseWithData (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:741:17)\n    at Object.raise (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:735:17)\n    at Object.unexpected (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:9097:16)\n    at Object.expect (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:9083:28)\n    at Object.jsxParseExpressionContainer (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:4613:10)\n    at Object.jsxParseElementAt (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:4704:36)\n    at Object.jsxParseElementAt (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:4689:32)\n    at Object.jsxParseElement (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:4747:17)\n    at Object.parseExprAtom (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:4754:19)",
        "D:\\_dev\\cake-vscode\\src\\shared\\utils\\getFetchOptions.ts": "SyntaxError: Unexpected token, expected \"}\" (53:9)\n    at Object._raise (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:748:17)\n    at Object.raiseWithData (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:741:17)\n    at Object.raise (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:735:17)\n    at Object.unexpected (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:9097:16)\n    at Object.expect (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:9083:28)\n    at Object.jsxParseExpressionContainer (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:4613:10)\n    at Object.jsxParseElementAt (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:4704:36)\n    at Object.jsxParseElementAt (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:4689:32)\n    at Object.jsxParseElement (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:4747:17)\n    at Object.parseExprAtom (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:4754:19)",
        "D:\\_dev\\cake-vscode\\src\\shared\\utils\\readConfigFile.ts":"SyntaxError: Unexpected token (55:4)\n    at Object._raise (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:748:17)\n    at Object.raiseWithData (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:741:17)\n    at Object.raise (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js:735:17)\n    at Object.unexpected (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js: 9097: 16)\n    at Object.parseExprAtom (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js: 10548: 20)\n    at Object.parseExprAtom (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js: 4759: 20)\n    at Object.parseExprSubscripts (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js: 10122: 23)\n    at Object.parseUpdate (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js: 10102: 21)\n    at Object.parseMaybeUnary (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js: 10091: 17)\n    at Object.parseMaybeUnary (D:\\_dev\\cake-vscode\\node_modules\\@babel\\parser\\lib\\index.js: 7122: 20)"},"invalidDirs":{}}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nils-acommented, Nov 24, 2020

@rumpl I re-visisted the usage of casting with <> vs casting with as and in the end it was only 6 places in 3 files to modify (two of those casts were actually not needed) so I went along and made the changes. No errors are reported in depcheck --json and no false positives anymore.

Thanks again for all your help!

(I’ll leave this open so you have a reminder on why you wanted to re-work the ts parser 😉 )

1reaction
rumplcommented, Nov 23, 2020

@nils-a I wish all the issues created were as thorough as yours is, thank you!

I will take a look

Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoiding false positives: rapid HIV tests vary in their accuracy ...
False negative results were rare. The findings confirm that the diagnosis of HIV should not be based on results from a single HIV...
Read more >
False-positive pathology: improving reproducibility with the ...
In particular, false positives in pathology affect patients through biomarker development, prognostic classification, and cancer overdiagnosis.
Read more >
False positive inspection for .ini files : RIDER-75530
False positive inspection for .ini files. STR. Download Vehicle Game from Epic Games Launcher (4.27); Open it in Rider; Go to BuggyPawn.cpp.
Read more >
False positive warning C4189: local variable is initialized but ...
The code compile fine with 16.9.5, these warnings appeared after updating to 16.10. fixed in: visual studio 2019 version 16.11.7Visual Studio ...
Read more >
MIRC server.ini FALSE POSITIVE? - Avast WEBforum
A false positive. ;) The scanned file was the original mirc servers.ini file renamed and changed to a text file. I've sent a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found