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 摘要。