github / github/codeql

General issue

未關閉
#12,211 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
question
主要語言
CodeQL
星號
10.1k
分支
2.1k
平均合併
2 天 15 小時
30 天內合併 PR
141

描述

I am looking at using CodeQL for my react app and am using the boiler plate to as much as n extent that I can.

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"

However, when adding poor conditions in the code such as

var unused : any;
if (unused == 'start')
console.log("something");
else if (unused == 'start')
console.log("something");

else
throw new Error("Message not understood.");

example https://codeql.github.com/codeql-query-help/javascript/js-duplicate-condition/

expecting CodeQL to throw an issue, this sailed through with no issues. Can someone please help and let me know what I have done wrong.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。