Showing 18 of 78 total issues
Function createInterface
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createInterface = (
answers: ICommon.IAnswers,
isClass: boolean,
createInterfaceParams: INextjsHelper.ICreateInterfaceParams
) => {
Function createInterface
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createInterface = (options: ICommon.IAnswers) => {
const { fileName, isPage, isConnectStore } = options;
const {
interfaceDir,
Function addReducer
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const addReducer = (
answers: ICommon.IAnswers,
params: INextjs2Helper.IAddReducerParams
): void => {
const {
Function addReducer
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const addReducer = (
answers: ICommon.IAnswers,
params: INextjsHelper.IAddReducerParams
): void => {
const {
Function createFuncComponent
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createFuncComponent = (options: ICommon.IAnswers): void => {
const {
templatePath,
indexTemplatePath,
componentTestTemplatePath,
Function createClassComponent
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createClassComponent = (options: ICommon.IAnswers): void => {
const {
templatePath,
indexTemplatePath,
addReducerParams,
Function createService
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createService = (options: ICommon.IAnswers): void => {
const addIndexParams: ICommon.IAddIndex = {
dirPath: `${moleculer.servicesDir}/index.ts`,
getFileContent: () =>
getTemplate(createServiceParams.indexTemplate, options),
Function createInterface
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createInterface = (
options: ICommon.IAnswers,
dirType: string,
prefix: string = ''
) => {
Function createRepository
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createRepository = (options: ICommon.IAnswers): void => {
const templatePath = createRepositoryParams.templatePath;
const indexTemplate = createRepositoryParams.indexTemplate;
Function createClassComponent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createClassComponent = (options: ICommon.IAnswers): void => {
const {
templatePath,
indexTemplatePath,
createInterfaceParams,
Function addAction
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const addAction = (
options: ICommon.IAnswers,
params: INextjs2Helper.IAddActionParams
): void => {
const {
Function createStyle
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createStyle = (options: ICommon.IAnswers): void => {
const { fileName, lowerFileName, isPage, isStyled, hasStyle } = options;
if (!hasStyle) return;
Function createFuncComponent
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createFuncComponent = (answers: ICommon.IAnswers): void => {
const { lowerFileName, fileName, hasStyle } = answers;
const {
componentsDir,
Function createParamsForAddBrokerHelper
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createParamsForAddBrokerHelper = (
type: 'import' | 'create',
options: ICommon.IAnswers
): ICommon.IReplaceContent => {
const {
Function createStyle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const createStyle = (options: ICommon.IAnswers): void => {
const { fileName, lowerFileName, isPage, isStyled, hasStyle } = options;
if (!hasStyle) return;
- 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 createInterface
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const createInterface = (
answers: ICommon.IAnswers,
isClass: boolean,
createInterfaceParams: INextjsHelper.ICreateInterfaceParams
) => {
- 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 createInterface
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const createInterface = (options: ICommon.IAnswers) => {
const { fileName, isPage, isConnectStore } = options;
const {
interfaceDir,
- 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 nextjs2
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const nextjs2 = (
// TODO: infer to Next2Element to supress can't assign to 'never'
// * passing as Element temporarily
// element: Next2Element,
element: ICommon.Element,
- 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"