Showing 13 of 40 total issues
Function get
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
get: (
choice: string,
projectType?: string,
): { title: string; description: string; value: string } => {
switch (choice) {
Function data
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
data(sao) {
/**
* Package Manager
*/
const answers = {
Function cli
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const cli = async (): Promise<void> => {
const program = commander
.name(packageData.name)
.version(packageData.version)
.arguments("<project-directory>")
- 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"
Further reading
Function get_potential_package_managers
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const get_potential_package_managers = (): Array<{
message: string;
name: string;
}> => {
const pmQuestionChoises = [
Function prompt_project_types
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const prompt_project_types = async (
source: string,
types: any[],
typeFromArgs?: string,
): Promise<[projectTypePath: string, projectType: string]> => {
Function actions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async actions(sao) {
const answers = {
...sao.opts.extras.presetAnswers,
...sao.answers,
};
- 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"
Further reading
Function get
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
get: (
choice: string,
projectType?: string,
): { title: string; description: string; value: string } => {
switch (choice) {
- 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"
Further reading
Function completed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async completed(saoInstance) {
const { debug, apiMode } = saoInstance.opts.extras;
/**
* Format generated project
- 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"
Further reading
Avoid too many return
statements within this function. Open
return { error: repoStatus.error };
Avoid too many return
statements within this function. Open
return { error: "Could not retrieve source repository." };
Avoid too many return
statements within this function. Open
return { path: cloneResponse };
Avoid too many return
statements within this function. Open
return { error: "Could not retrieve source repository." };
Function prompt_project_types
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const prompt_project_types = async (
source: string,
types: any[],
typeFromArgs?: string,
): Promise<[projectTypePath: string, projectType: string]> => {
- 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"