Atlas integration for authentication, user settings, email confirmation, uploads #1654
feat/atlas-siwe
into dev
Function uploadToIpfs
has 30 lines of code (exceeds 25 allowed). Consider refactoring. New
export async function uploadToIpfs(config: Config, payload: IpfsUploadPayload): Promise<string | null> {
const formData = new FormData();
formData.append("file", payload.file, payload.name);
formData.append("name", payload.name);
formData.append("product", payload.product);
- Create a ticketCreate a ticket
Function handleSubmit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. New
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (!address) {
throw new Error("Missing address");
}
- Create a ticketCreate a ticket
Function EmailConfirmation
has 48 lines of code (exceeds 25 allowed). Consider refactoring. New
const EmailConfirmation: React.FC = () => {
const { confirmEmail } = useAtlasProvider();
const [isConfirming, setIsConfirming] = useState(false);
const [isConfirmed, setIsConfirmed] = useState(false);
- Create a ticketCreate a ticket
Similar blocks of code found in 8 locations. Consider refactoring. New
const Container = styled.div`
width: 100%;
background-color: ${({ theme }) => theme.lightBackground};
padding: ${responsiveSize(32, 80)} ${responsiveSize(24, 136)} ${responsiveSize(76, 96)};
max-width: 1780px;
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 65.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 5 locations. Consider refactoring. New
const StyledButton = styled(Button)`
display: inline-block;
background-color: transparent;
padding: 0;
.button-text {
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 56.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. New
if (userExists) {
const data = {
newEmail: emailInput,
};
updateEmail(data)
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 70.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. New
} else {
const data = {
email: emailInput,
};
addUser(data)
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 70.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. New
if (response.status !== 200) {
const error = await response.json().catch(() => ({ message: "Error uploading to IPFS" }));
throw new Error(error.message);
}
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 48.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. New
if (!response.ok) {
const error = await response.json().catch(() => ({ message: "Error uploading to IPFS" }));
throw new Error(error.message);
}
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 48.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
unused expression, expected an assignment or function call New
export const createMessage = (address: `0x${string}`, nonce: string, chainId: number = DEFAULT_CHAIN) => {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
unused expression, expected an assignment or function call New
export const createMessage = (address: `0x${string}`, nonce: string, chainId: number = DEFAULT_CHAIN) => {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
missing whitespace New
export const createMessage = (address: `0x${string}`, nonce: string, chainId: number = DEFAULT_CHAIN) => {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: whitespace
Enforces whitespace style conventions.
Rationale
Helps maintain a readable, consistent style in your codebase.
Notes
- Has Fix
Config
Several arguments may be optionally provided:
-
"check-branch"
checks branching statements (if
/else
/for
/while
) are followed by whitespace. -
"check-decl"
checks that variable declarations have whitespace around the equals token. -
"check-operator"
checks for whitespace around operator tokens. -
"check-module"
checks for whitespace in import & export statements. -
"check-separator"
checks for whitespace after separator tokens (,
/;
). -
"check-rest-spread"
checks that there is no whitespace after rest/spread operator (...
). -
"check-type"
checks for whitespace before a variable type specification. -
"check-typecast"
checks for whitespace between a typecast and its target. -
"check-type-operator"
checks for whitespace between type operators|
and&
. -
"check-preblock"
checks for whitespace before the opening brace of a block. -
"check-postbrace"
checks for whitespace after an opening brace.
Examples
"whitespace": true,check-branch,check-operator,check-typecast
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-rest-spread",
"check-type",
"check-typecast",
"check-type-operator",
"check-preblock",
"check-postbrace"
]
},
"minLength": 0,
"maxLength": 11
}
For more information see this page.
Do not use comma operator here because it can be easily misunderstood or lead to unintended bugs. New
export const createMessage = (address: `0x${string}`, nonce: string, chainId: number = DEFAULT_CHAIN) => {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: ban-comma-operator
Disallows the comma operator to be used.
Read more about the comma operator here.
Rationale
Using the comma operator can create a potential for many non-obvious bugs or lead to misunderstanding of code.
Examples
foo((bar, baz)); // evaluates to 'foo(baz)' because of the extra parens - confusing and not obvious
switch (foo) {
case 1, 2: // equals 'case 2' - probably intended 'case 1: case2:'
return true;
case 3:
return false;
}
let x = (y = 1, z = 2); // x is equal to 2 - this may not be immediately obvious.
Examples
"ban-comma-operator": true
For more information see this page.
Do not use comma operator here because it can be easily misunderstood or lead to unintended bugs. New
export const createMessage = (address: `0x${string}`, nonce: string, chainId: number = DEFAULT_CHAIN) => {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: ban-comma-operator
Disallows the comma operator to be used.
Read more about the comma operator here.
Rationale
Using the comma operator can create a potential for many non-obvious bugs or lead to misunderstanding of code.
Examples
foo((bar, baz)); // evaluates to 'foo(baz)' because of the extra parens - confusing and not obvious
switch (foo) {
case 1, 2: // equals 'case 2' - probably intended 'case 1: case2:'
return true;
case 3:
return false;
}
let x = (y = 1, z = 2); // x is equal to 2 - this may not be immediately obvious.
Examples
"ban-comma-operator": true
For more information see this page.
Missing semicolon New
export const createMessage = (address: `0x${string}`, nonce: string, chainId: number = DEFAULT_CHAIN) => {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Missing semicolon New
export const createMessage = (address: `0x${string}`, nonce: string, chainId: number = DEFAULT_CHAIN) => {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Missing semicolon New
export const createMessage = (address: `0x${string}`, nonce: string, chainId: number = DEFAULT_CHAIN) => {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Missing semicolon New
export const createMessage = (address: `0x${string}`, nonce: string, chainId: number = DEFAULT_CHAIN) => {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Unnecessary semicolon New
};
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
unexpected label on statement New
message: string;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: label-position
Only allows labels in sensible locations.
This rule only allows labels to be on do/for/while/switch
statements.
Rationale
Labels in JavaScript only can be used in conjunction with break
or continue
,
constructs meant to be used for loop flow control. While you can theoretically use
labels on any block statement in JS, it is considered poor code structure to do so.
Config
Not configurable.
Examples
"label-position": true
For more information see this page.
unused expression, expected an assignment or function call New
signature: `0x${string}`;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
unused expression, expected an assignment or function call New
message: string;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
statements are not aligned New
signature: `0x${string}`;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: align
Enforces vertical alignment.
Rationale
Helps maintain a readable, consistent style in your codebase.
Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.
Notes
- Has Fix
Config
Five arguments may be optionally provided:
-
"parameters"
checks alignment of function parameters. -
"arguments"
checks alignment of function call arguments. -
"statements"
checks alignment of statements. -
"members"
checks alignment of members of classes, interfaces, type literal, object literals and object destructuring. -
"elements"
checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"arguments",
"elements",
"members",
"parameters",
"statements"
]
},
"minLength": 1,
"maxLength": 5
}
For more information see this page.
statements are not aligned New
message: string;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: align
Enforces vertical alignment.
Rationale
Helps maintain a readable, consistent style in your codebase.
Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.
Notes
- Has Fix
Config
Five arguments may be optionally provided:
-
"parameters"
checks alignment of function parameters. -
"arguments"
checks alignment of function call arguments. -
"statements"
checks alignment of statements. -
"members"
checks alignment of members of classes, interfaces, type literal, object literals and object destructuring. -
"elements"
checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"arguments",
"elements",
"members",
"parameters",
"statements"
]
},
"minLength": 1,
"maxLength": 5
}
For more information see this page.
missing whitespace New
signature: `0x${string}`;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: whitespace
Enforces whitespace style conventions.
Rationale
Helps maintain a readable, consistent style in your codebase.
Notes
- Has Fix
Config
Several arguments may be optionally provided:
-
"check-branch"
checks branching statements (if
/else
/for
/while
) are followed by whitespace. -
"check-decl"
checks that variable declarations have whitespace around the equals token. -
"check-operator"
checks for whitespace around operator tokens. -
"check-module"
checks for whitespace in import & export statements. -
"check-separator"
checks for whitespace after separator tokens (,
/;
). -
"check-rest-spread"
checks that there is no whitespace after rest/spread operator (...
). -
"check-type"
checks for whitespace before a variable type specification. -
"check-typecast"
checks for whitespace between a typecast and its target. -
"check-type-operator"
checks for whitespace between type operators|
and&
. -
"check-preblock"
checks for whitespace before the opening brace of a block. -
"check-postbrace"
checks for whitespace after an opening brace.
Examples
"whitespace": true,check-branch,check-operator,check-typecast
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-rest-spread",
"check-type",
"check-typecast",
"check-type-operator",
"check-preblock",
"check-postbrace"
]
},
"minLength": 0,
"maxLength": 11
}
For more information see this page.
Missing semicolon New
signature: `0x${string}`;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Unnecessary semicolon New
};
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Unnecessary 'await'. New
return await response.text();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-return-await
Disallows unnecessary return await
.
Rationale
An async function always wraps the return value in a Promise.
Using return await
just adds extra time before the overreaching promise is resolved without changing the semantics.
Notes
- Has Fix
Config
Not configurable.
Examples
"no-return-await": true
For more information see this page.
File supabase-datalake.ts
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Fixed
- Create a ticketCreate a ticket
Function authMiddleware
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
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 authMiddleware
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Fixed
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Fixed
- Create a ticketCreate a ticket
Function authUser
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
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 authUser
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Fixed
- Create a ticketCreate a ticket
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 105.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 105.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 105.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 76.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 76.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 76.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 69.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 69.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 69.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 52.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 52.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 52.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 50.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 50.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 50.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 45.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 45.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 45.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 52.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 52.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 49.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Fixed
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 49.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
unexpected label on statement Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: label-position
Only allows labels in sensible locations.
This rule only allows labels to be on do/for/while/switch
statements.
Rationale
Labels in JavaScript only can be used in conjunction with break
or continue
,
constructs meant to be used for loop flow control. While you can theoretically use
labels on any block statement in JS, it is considered poor code structure to do so.
Config
Not configurable.
Examples
"label-position": true
For more information see this page.
unexpected label on statement Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: label-position
Only allows labels in sensible locations.
This rule only allows labels to be on do/for/while/switch
statements.
Rationale
Labels in JavaScript only can be used in conjunction with break
or continue
,
constructs meant to be used for loop flow control. While you can theoretically use
labels on any block statement in JS, it is considered poor code structure to do so.
Config
Not configurable.
Examples
"label-position": true
For more information see this page.
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
statements are not aligned Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: align
Enforces vertical alignment.
Rationale
Helps maintain a readable, consistent style in your codebase.
Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.
Notes
- Has Fix
Config
Five arguments may be optionally provided:
-
"parameters"
checks alignment of function parameters. -
"arguments"
checks alignment of function call arguments. -
"statements"
checks alignment of statements. -
"members"
checks alignment of members of classes, interfaces, type literal, object literals and object destructuring. -
"elements"
checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"arguments",
"elements",
"members",
"parameters",
"statements"
]
},
"minLength": 1,
"maxLength": 5
}
For more information see this page.
statements are not aligned Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: align
Enforces vertical alignment.
Rationale
Helps maintain a readable, consistent style in your codebase.
Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.
Notes
- Has Fix
Config
Five arguments may be optionally provided:
-
"parameters"
checks alignment of function parameters. -
"arguments"
checks alignment of function call arguments. -
"statements"
checks alignment of statements. -
"members"
checks alignment of members of classes, interfaces, type literal, object literals and object destructuring. -
"elements"
checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"arguments",
"elements",
"members",
"parameters",
"statements"
]
},
"minLength": 1,
"maxLength": 5
}
For more information see this page.
statements are not aligned Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: align
Enforces vertical alignment.
Rationale
Helps maintain a readable, consistent style in your codebase.
Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.
Notes
- Has Fix
Config
Five arguments may be optionally provided:
-
"parameters"
checks alignment of function parameters. -
"arguments"
checks alignment of function call arguments. -
"statements"
checks alignment of statements. -
"members"
checks alignment of members of classes, interfaces, type literal, object literals and object destructuring. -
"elements"
checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"arguments",
"elements",
"members",
"parameters",
"statements"
]
},
"minLength": 1,
"maxLength": 5
}
For more information see this page.
Type assertion on object literals is forbidden, use a type annotation instead. Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-object-literal-type-assertion
Forbids an object literal to appear in a type assertion expression.
Casting to any
or to unknown
is still allowed.
Rationale
Always prefer const x: T = { ... };
to const x = { ... } as T;
.
The type assertion in the latter case is either unnecessary or hides an error.
The compiler will warn for excess properties with this syntax, but not missing required fields.
For example: const x: { foo: number } = {}
will fail to compile, but
const x = {} as { foo: number }
will succeed.
Additionally, the const assertion const x = { foo: 1 } as const
,
introduced in TypeScript 3.4, is considered beneficial and is ignored by this rule.
Notes
- TypeScript Only
Config
One option may be configured:
-
allow-arguments
allows type assertions to be used on object literals inside call expressions.
Examples
"no-object-literal-type-assertion": true
"no-object-literal-type-assertion": true,[object Object]
Schema
{
"type": "object",
"properties": {
"allow-arguments": {
"type": "boolean"
}
},
"additionalProperties": false
}
For more information see this page.
missing whitespace Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: whitespace
Enforces whitespace style conventions.
Rationale
Helps maintain a readable, consistent style in your codebase.
Notes
- Has Fix
Config
Several arguments may be optionally provided:
-
"check-branch"
checks branching statements (if
/else
/for
/while
) are followed by whitespace. -
"check-decl"
checks that variable declarations have whitespace around the equals token. -
"check-operator"
checks for whitespace around operator tokens. -
"check-module"
checks for whitespace in import & export statements. -
"check-separator"
checks for whitespace after separator tokens (,
/;
). -
"check-rest-spread"
checks that there is no whitespace after rest/spread operator (...
). -
"check-type"
checks for whitespace before a variable type specification. -
"check-typecast"
checks for whitespace between a typecast and its target. -
"check-type-operator"
checks for whitespace between type operators|
and&
. -
"check-preblock"
checks for whitespace before the opening brace of a block. -
"check-postbrace"
checks for whitespace after an opening brace.
Examples
"whitespace": true,check-branch,check-operator,check-typecast
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-rest-spread",
"check-type",
"check-typecast",
"check-type-operator",
"check-preblock",
"check-postbrace"
]
},
"minLength": 0,
"maxLength": 11
}
For more information see this page.
Missing semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
unexpected label on statement Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: label-position
Only allows labels in sensible locations.
This rule only allows labels to be on do/for/while/switch
statements.
Rationale
Labels in JavaScript only can be used in conjunction with break
or continue
,
constructs meant to be used for loop flow control. While you can theoretically use
labels on any block statement in JS, it is considered poor code structure to do so.
Config
Not configurable.
Examples
"label-position": true
For more information see this page.
unexpected label on statement Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: label-position
Only allows labels in sensible locations.
This rule only allows labels to be on do/for/while/switch
statements.
Rationale
Labels in JavaScript only can be used in conjunction with break
or continue
,
constructs meant to be used for loop flow control. While you can theoretically use
labels on any block statement in JS, it is considered poor code structure to do so.
Config
Not configurable.
Examples
"label-position": true
For more information see this page.
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
statements are not aligned Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: align
Enforces vertical alignment.
Rationale
Helps maintain a readable, consistent style in your codebase.
Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.
Notes
- Has Fix
Config
Five arguments may be optionally provided:
-
"parameters"
checks alignment of function parameters. -
"arguments"
checks alignment of function call arguments. -
"statements"
checks alignment of statements. -
"members"
checks alignment of members of classes, interfaces, type literal, object literals and object destructuring. -
"elements"
checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"arguments",
"elements",
"members",
"parameters",
"statements"
]
},
"minLength": 1,
"maxLength": 5
}
For more information see this page.
statements are not aligned Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: align
Enforces vertical alignment.
Rationale
Helps maintain a readable, consistent style in your codebase.
Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.
Notes
- Has Fix
Config
Five arguments may be optionally provided:
-
"parameters"
checks alignment of function parameters. -
"arguments"
checks alignment of function call arguments. -
"statements"
checks alignment of statements. -
"members"
checks alignment of members of classes, interfaces, type literal, object literals and object destructuring. -
"elements"
checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"arguments",
"elements",
"members",
"parameters",
"statements"
]
},
"minLength": 1,
"maxLength": 5
}
For more information see this page.
statements are not aligned Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: align
Enforces vertical alignment.
Rationale
Helps maintain a readable, consistent style in your codebase.
Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.
Notes
- Has Fix
Config
Five arguments may be optionally provided:
-
"parameters"
checks alignment of function parameters. -
"arguments"
checks alignment of function call arguments. -
"statements"
checks alignment of statements. -
"members"
checks alignment of members of classes, interfaces, type literal, object literals and object destructuring. -
"elements"
checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"arguments",
"elements",
"members",
"parameters",
"statements"
]
},
"minLength": 1,
"maxLength": 5
}
For more information see this page.
missing whitespace Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: whitespace
Enforces whitespace style conventions.
Rationale
Helps maintain a readable, consistent style in your codebase.
Notes
- Has Fix
Config
Several arguments may be optionally provided:
-
"check-branch"
checks branching statements (if
/else
/for
/while
) are followed by whitespace. -
"check-decl"
checks that variable declarations have whitespace around the equals token. -
"check-operator"
checks for whitespace around operator tokens. -
"check-module"
checks for whitespace in import & export statements. -
"check-separator"
checks for whitespace after separator tokens (,
/;
). -
"check-rest-spread"
checks that there is no whitespace after rest/spread operator (...
). -
"check-type"
checks for whitespace before a variable type specification. -
"check-typecast"
checks for whitespace between a typecast and its target. -
"check-type-operator"
checks for whitespace between type operators|
and&
. -
"check-preblock"
checks for whitespace before the opening brace of a block. -
"check-postbrace"
checks for whitespace after an opening brace.
Examples
"whitespace": true,check-branch,check-operator,check-typecast
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-rest-spread",
"check-type",
"check-typecast",
"check-type-operator",
"check-preblock",
"check-postbrace"
]
},
"minLength": 0,
"maxLength": 11
}
For more information see this page.
Missing semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Unnecessary semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
statements are not aligned Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: align
Enforces vertical alignment.
Rationale
Helps maintain a readable, consistent style in your codebase.
Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.
Notes
- Has Fix
Config
Five arguments may be optionally provided:
-
"parameters"
checks alignment of function parameters. -
"arguments"
checks alignment of function call arguments. -
"statements"
checks alignment of statements. -
"members"
checks alignment of members of classes, interfaces, type literal, object literals and object destructuring. -
"elements"
checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"arguments",
"elements",
"members",
"parameters",
"statements"
]
},
"minLength": 1,
"maxLength": 5
}
For more information see this page.
missing whitespace Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: whitespace
Enforces whitespace style conventions.
Rationale
Helps maintain a readable, consistent style in your codebase.
Notes
- Has Fix
Config
Several arguments may be optionally provided:
-
"check-branch"
checks branching statements (if
/else
/for
/while
) are followed by whitespace. -
"check-decl"
checks that variable declarations have whitespace around the equals token. -
"check-operator"
checks for whitespace around operator tokens. -
"check-module"
checks for whitespace in import & export statements. -
"check-separator"
checks for whitespace after separator tokens (,
/;
). -
"check-rest-spread"
checks that there is no whitespace after rest/spread operator (...
). -
"check-type"
checks for whitespace before a variable type specification. -
"check-typecast"
checks for whitespace between a typecast and its target. -
"check-type-operator"
checks for whitespace between type operators|
and&
. -
"check-preblock"
checks for whitespace before the opening brace of a block. -
"check-postbrace"
checks for whitespace after an opening brace.
Examples
"whitespace": true,check-branch,check-operator,check-typecast
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-rest-spread",
"check-type",
"check-typecast",
"check-type-operator",
"check-preblock",
"check-postbrace"
]
},
"minLength": 0,
"maxLength": 11
}
For more information see this page.
Missing semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Unnecessary semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
block is empty Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-empty
Disallows empty blocks.
Blocks with a comment inside are not considered empty.
Rationale
Empty blocks are often indicators of missing code.
Config
If allow-empty-catch
is specified, then catch blocks are allowed to be empty.
If allow-empty-functions
is specified, then function definitions are allowed to be empty.
Examples
"no-empty": true
"no-empty": true,allow-empty-catch
"no-empty": true,allow-empty-functions
"no-empty": true,allow-empty-catch,allow-empty-functions
Schema
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"enum": [
"allow-empty-catch"
]
},
{
"type": "string",
"enum": [
"allow-empty-functions"
]
}
]
}
}
For more information see this page.
object access via string literals is disallowed Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-string-literal
Forbids unnecessary string literal property access.
Allows obj["prop-erty"]
(can't be a regular property access).
Disallows obj["property"]
(should be obj.property
).
Rationale
If --noImplicitAny
is turned off,
property access via a string literal will be 'any' if the property does not exist.
Notes
- Has Fix
Config
Not configurable.
Examples
"no-string-literal": true
For more information see this page.
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
missing whitespace Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: whitespace
Enforces whitespace style conventions.
Rationale
Helps maintain a readable, consistent style in your codebase.
Notes
- Has Fix
Config
Several arguments may be optionally provided:
-
"check-branch"
checks branching statements (if
/else
/for
/while
) are followed by whitespace. -
"check-decl"
checks that variable declarations have whitespace around the equals token. -
"check-operator"
checks for whitespace around operator tokens. -
"check-module"
checks for whitespace in import & export statements. -
"check-separator"
checks for whitespace after separator tokens (,
/;
). -
"check-rest-spread"
checks that there is no whitespace after rest/spread operator (...
). -
"check-type"
checks for whitespace before a variable type specification. -
"check-typecast"
checks for whitespace between a typecast and its target. -
"check-type-operator"
checks for whitespace between type operators|
and&
. -
"check-preblock"
checks for whitespace before the opening brace of a block. -
"check-postbrace"
checks for whitespace after an opening brace.
Examples
"whitespace": true,check-branch,check-operator,check-typecast
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-rest-spread",
"check-type",
"check-typecast",
"check-type-operator",
"check-preblock",
"check-postbrace"
]
},
"minLength": 0,
"maxLength": 11
}
For more information see this page.
Do not use comma operator here because it can be easily misunderstood or lead to unintended bugs. Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: ban-comma-operator
Disallows the comma operator to be used.
Read more about the comma operator here.
Rationale
Using the comma operator can create a potential for many non-obvious bugs or lead to misunderstanding of code.
Examples
foo((bar, baz)); // evaluates to 'foo(baz)' because of the extra parens - confusing and not obvious
switch (foo) {
case 1, 2: // equals 'case 2' - probably intended 'case 1: case2:'
return true;
case 3:
return false;
}
let x = (y = 1, z = 2); // x is equal to 2 - this may not be immediately obvious.
Examples
"ban-comma-operator": true
For more information see this page.
Do not use comma operator here because it can be easily misunderstood or lead to unintended bugs. Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: ban-comma-operator
Disallows the comma operator to be used.
Read more about the comma operator here.
Rationale
Using the comma operator can create a potential for many non-obvious bugs or lead to misunderstanding of code.
Examples
foo((bar, baz)); // evaluates to 'foo(baz)' because of the extra parens - confusing and not obvious
switch (foo) {
case 1, 2: // equals 'case 2' - probably intended 'case 1: case2:'
return true;
case 3:
return false;
}
let x = (y = 1, z = 2); // x is equal to 2 - this may not be immediately obvious.
Examples
"ban-comma-operator": true
For more information see this page.
Missing semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Missing semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Missing semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
object access via string literals is disallowed Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-string-literal
Forbids unnecessary string literal property access.
Allows obj["prop-erty"]
(can't be a regular property access).
Disallows obj["property"]
(should be obj.property
).
Rationale
If --noImplicitAny
is turned off,
property access via a string literal will be 'any' if the property does not exist.
Notes
- Has Fix
Config
Not configurable.
Examples
"no-string-literal": true
For more information see this page.
Unnecessary initialization to 'undefined'. Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unnecessary-initializer
Forbids a 'var'/'let' statement or destructuring initializer to be initialized to 'undefined'.
Rationale
Values in JavaScript default to undefined
.
There's no need to do so manually.
Notes
- Has Fix
Config
Not configurable.
Examples
"no-unnecessary-initializer": true
For more information see this page.
object access via string literals is disallowed Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-string-literal
Forbids unnecessary string literal property access.
Allows obj["prop-erty"]
(can't be a regular property access).
Disallows obj["property"]
(should be obj.property
).
Rationale
If --noImplicitAny
is turned off,
property access via a string literal will be 'any' if the property does not exist.
Notes
- Has Fix
Config
Not configurable.
Examples
"no-string-literal": true
For more information see this page.
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
Missing semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
Expected property shorthand in object literal ('{nonce}'). Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: object-literal-shorthand
Enforces/disallows use of ES6 object literal shorthand.
Notes
- Has Fix
Config
"always"
assumed to be default option, thus with no options provided
the rule enforces object literal methods and properties shorthands.
With "never"
option provided, any shorthand object literal syntax causes an error.
The rule can be configured in a more granular way.
With {"property": "never"}
provided (which is equivalent to {"property": "never", "method": "always"}
),
the rule only flags property shorthand assignments,
and respectively with {"method": "never"}
(equivalent to {"property": "always", "method": "never"}
),
the rule fails only on method shorthands.
Examples
"object-literal-shorthand": true
"object-literal-shorthand": true,never
"object-literal-shorthand": true,[object Object]
Schema
{
"oneOf": [
{
"type": "string",
"enum": [
"never"
]
},
{
"type": "object",
"properties": {
"property": {
"type": "string",
"enum": [
"never"
]
},
"method": {
"type": "string",
"enum": [
"never"
]
}
},
"minProperties": 1,
"maxProperties": 2
}
]
}
For more information see this page.
Missing semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Shadowed name: 'error' Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-shadowed-variable
Disallows shadowing variable declarations.
Rationale
When a variable in a local scope and a variable in the containing scope have the same name, shadowing occurs. Shadowing makes it impossible to access the variable in the containing scope and obscures to what value an identifier actually refers. Compare the following snippets:
const a = 'no shadow';
function print() {
console.log(a);
}
print(); // logs 'no shadow'.
const a = 'no shadow';
function print() {
const a = 'shadow'; // TSLint will complain here.
console.log(a);
}
print(); // logs 'shadow'.
ESLint has an equivalent rule. For more background information, refer to this MDN closure doc.
Config
You can optionally pass an object to disable checking for certain kinds of declarations.
Possible keys are "class"
, "enum"
, "function"
, "import"
, "interface"
, "namespace"
, "typeAlias"
and "typeParameter"
. You can also pass "underscore
" to ignore variable names that begin with _
.
Just set the value to false
for the check you want to disable.
All checks default to true
, i.e. are enabled by default.
Note that you cannot disable variables and parameters.
The option "temporalDeadZone"
defaults to true
which shows errors when shadowing block scoped declarations in their
temporal dead zone. When set to false
parameters, classes, enums and variables declared
with let
or const
are not considered shadowed if the shadowing occurs within their
temporal dead zone.
The following example shows how the "temporalDeadZone"
option changes the linting result:
function fn(value) {
if (value) {
const tmp = value; // no error on this line if "temporalDeadZone" is false
return tmp;
}
let tmp = undefined;
if (!value) {
const tmp = value; // this line always contains an error
return tmp;
}
}
Examples
"no-shadowed-variable": true
"no-shadowed-variable": true,[object Object]
Schema
{
"type": "object",
"properties": {
"class": {
"type": "boolean"
},
"enum": {
"type": "boolean"
},
"function": {
"type": "boolean"
},
"import": {
"type": "boolean"
},
"interface": {
"type": "boolean"
},
"namespace": {
"type": "boolean"
},
"typeAlias": {
"type": "boolean"
},
"typeParameter": {
"type": "boolean"
},
"temporalDeadZone": {
"type": "boolean"
},
"underscore": {
"type": "boolean"
}
}
}
For more information see this page.
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-unused-expression
Disallows unused expression statements.
Unused expressions are expression statements which are not assignments or function calls (and thus usually no-ops).
Rationale
Detects potential errors where an assignment or function call was intended.
Config
Three arguments may be optionally provided:
-
allow-fast-null-checks
allows to use logical operators to perform fast null checks and perform method or function calls for side effects (e.g.e && e.preventDefault()
). -
allow-new
allows 'new' expressions for side effects (e.g.new ModifyGlobalState();
. -
allow-tagged-template
allows tagged templates for side effects (e.g.this.add\
foo`;`.
Examples
"no-unused-expression": true
"no-unused-expression": true,allow-fast-null-checks
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"allow-fast-null-checks",
"allow-new",
"allow-tagged-template"
]
},
"minLength": 0,
"maxLength": 3
}
For more information see this page.
Expected property shorthand in object literal ('{email}'). Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: object-literal-shorthand
Enforces/disallows use of ES6 object literal shorthand.
Notes
- Has Fix
Config
"always"
assumed to be default option, thus with no options provided
the rule enforces object literal methods and properties shorthands.
With "never"
option provided, any shorthand object literal syntax causes an error.
The rule can be configured in a more granular way.
With {"property": "never"}
provided (which is equivalent to {"property": "never", "method": "always"}
),
the rule only flags property shorthand assignments,
and respectively with {"method": "never"}
(equivalent to {"property": "always", "method": "never"}
),
the rule fails only on method shorthands.
Examples
"object-literal-shorthand": true
"object-literal-shorthand": true,never
"object-literal-shorthand": true,[object Object]
Schema
{
"oneOf": [
{
"type": "string",
"enum": [
"never"
]
},
{
"type": "object",
"properties": {
"property": {
"type": "string",
"enum": [
"never"
]
},
"method": {
"type": "string",
"enum": [
"never"
]
}
},
"minProperties": 1,
"maxProperties": 2
}
]
}
For more information see this page.
Expected property shorthand in object literal ('{telegram}'). Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: object-literal-shorthand
Enforces/disallows use of ES6 object literal shorthand.
Notes
- Has Fix
Config
"always"
assumed to be default option, thus with no options provided
the rule enforces object literal methods and properties shorthands.
With "never"
option provided, any shorthand object literal syntax causes an error.
The rule can be configured in a more granular way.
With {"property": "never"}
provided (which is equivalent to {"property": "never", "method": "always"}
),
the rule only flags property shorthand assignments,
and respectively with {"method": "never"}
(equivalent to {"property": "always", "method": "never"}
),
the rule fails only on method shorthands.
Examples
"object-literal-shorthand": true
"object-literal-shorthand": true,never
"object-literal-shorthand": true,[object Object]
Schema
{
"oneOf": [
{
"type": "string",
"enum": [
"never"
]
},
{
"type": "object",
"properties": {
"property": {
"type": "string",
"enum": [
"never"
]
},
"method": {
"type": "string",
"enum": [
"never"
]
}
},
"minProperties": 1,
"maxProperties": 2
}
]
}
For more information see this page.
statements are not aligned Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: align
Enforces vertical alignment.
Rationale
Helps maintain a readable, consistent style in your codebase.
Consistent alignment for code statements helps keep code readable and clear. Statements misaligned from the standard can be harder to read and understand.
Notes
- Has Fix
Config
Five arguments may be optionally provided:
-
"parameters"
checks alignment of function parameters. -
"arguments"
checks alignment of function call arguments. -
"statements"
checks alignment of statements. -
"members"
checks alignment of members of classes, interfaces, type literal, object literals and object destructuring. -
"elements"
checks alignment of elements of array literals, array destructuring and tuple types.
Examples
"align": true,parameters,statements
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"arguments",
"elements",
"members",
"parameters",
"statements"
]
},
"minLength": 1,
"maxLength": 5
}
For more information see this page.
missing whitespace Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: whitespace
Enforces whitespace style conventions.
Rationale
Helps maintain a readable, consistent style in your codebase.
Notes
- Has Fix
Config
Several arguments may be optionally provided:
-
"check-branch"
checks branching statements (if
/else
/for
/while
) are followed by whitespace. -
"check-decl"
checks that variable declarations have whitespace around the equals token. -
"check-operator"
checks for whitespace around operator tokens. -
"check-module"
checks for whitespace in import & export statements. -
"check-separator"
checks for whitespace after separator tokens (,
/;
). -
"check-rest-spread"
checks that there is no whitespace after rest/spread operator (...
). -
"check-type"
checks for whitespace before a variable type specification. -
"check-typecast"
checks for whitespace between a typecast and its target. -
"check-type-operator"
checks for whitespace between type operators|
and&
. -
"check-preblock"
checks for whitespace before the opening brace of a block. -
"check-postbrace"
checks for whitespace after an opening brace.
Examples
"whitespace": true,check-branch,check-operator,check-typecast
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-rest-spread",
"check-type",
"check-typecast",
"check-type-operator",
"check-preblock",
"check-postbrace"
]
},
"minLength": 0,
"maxLength": 11
}
For more information see this page.
Missing semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Unnecessary semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Missing semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: semicolon
Enforces consistent semicolon usage at the end of every statement.
Notes
- Has Fix
Config
One of the following arguments must be provided:
-
"always"
enforces semicolons at the end of every statement. -
"never"
disallows semicolons at the end of every statement except for when they are necessary.
The following arguments may be optionally provided:
-
"ignore-interfaces"
skips checking semicolons at the end of interface members. -
"ignore-bound-class-methods"
skips checking semicolons at the end of bound class methods. -
"strict-bound-class-methods"
disables any special handling of bound class methods and treats them as any other assignment. This option overrides"ignore-bound-class-methods"
.
Examples
"semicolon": true,always
"semicolon": true,never
"semicolon": true,always,ignore-interfaces
"semicolon": true,always,ignore-bound-class-methods
Schema
{
"type": "array",
"items": [
{
"type": "string",
"enum": [
"always",
"never"
]
},
{
"type": "string",
"enum": [
"ignore-interfaces"
]
}
],
"additionalItems": false
}
For more information see this page.
Array type using 'Array<t>' is forbidden. Use 'T[]' instead.</t> Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: array-type
Requires using either 'T[]' or 'Array<t>' for arrays.</t>
Notes
- TypeScript Only
- Has Fix
Config
One of the following arguments must be provided:
-
"array"
enforces use ofT[]
for all types T. -
"generic"
enforces use ofArray<T>
for all types T. -
"array-simple"
enforces use ofT[]
ifT
is a simple type (primitive or type reference).
Examples
"array-type": true,array
"array-type": true,generic
"array-type": true,array-simple
Schema
{
"type": "string",
"enum": [
"array",
"generic",
"array-simple"
]
}
For more information see this page.
comment must start with a space Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: comment-format
Enforces formatting rules for single-line comments.
Rationale
Helps maintain a consistent, readable style in your codebase.
Notes
- Has Fix
Config
Four arguments may be optionally provided:
-
"check-space"
requires that all single-line comments must begin with a space, as in// comment
- note that for comments starting with multiple slashes, e.g.
///
, leading slashes are ignored - TypeScript reference comments are ignored completely
- note that for comments starting with multiple slashes, e.g.
-
"check-lowercase"
requires that the first non-whitespace character of a comment must be lowercase, if applicable. -
"check-uppercase"
requires that the first non-whitespace character of a comment must be uppercase, if applicable. -
"allow-trailing-lowercase"
allows that only the first comment of a series of comments needs to be uppercase.- requires
"check-uppercase"
- comments must start at the same position
- requires
Exceptions to "check-lowercase"
or "check-uppercase"
can be managed with object that may be passed as last
argument.
One of two options can be provided in this object:
-
"ignore-words"
- array of strings - words that will be ignored at the beginning of the comment. -
"ignore-pattern"
- string - RegExp pattern that will be ignored at the beginning of the comment.
Examples
"comment-format": true,check-space,check-uppercase,allow-trailing-lowercase
"comment-format": true,check-lowercase,[object Object]
"comment-format": true,check-lowercase,[object Object]
Schema
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"enum": [
"check-space",
"check-lowercase",
"check-uppercase",
"allow-trailing-lowercase"
]
},
{
"type": "object",
"properties": {
"ignore-words": {
"type": "array",
"items": {
"type": "string"
}
},
"ignore-pattern": {
"type": "string"
}
},
"minProperties": 1,
"maxProperties": 1
}
]
},
"minLength": 1,
"maxLength": 5
}
For more information see this page.