src/main-process/parse-command-line.js
Function parseCommandLine
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function parseCommandLine(processArgs) {
// macOS Gatekeeper adds a flag ("-psn_0_[six or seven digits here]") when it intercepts Atom launches.
// (This happens for fresh downloads, new installs, or first launches after upgrading).
// We don't need this flag, and yargs interprets it as many short flags. So, we filter it out.
const filteredArgs = processArgs.filter(arg => !arg.startsWith('-psn_'));
Function parseCommandLine
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function parseCommandLine(processArgs) {
// macOS Gatekeeper adds a flag ("-psn_0_[six or seven digits here]") when it intercepts Atom launches.
// (This happens for fresh downloads, new installs, or first launches after upgrading).
// We don't need this flag, and yargs interprets it as many short flags. So, we filter it out.
const filteredArgs = processArgs.filter(arg => !arg.startsWith('-psn_'));
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"