Showing 16 of 41 total issues
Function onData
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
@action
@waitFor
async onData(data: EncryptedMessage) {
if (isDestroyed(this)) return;
Function onData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
@action
@waitFor
async onData(data: EncryptedMessage) {
if (isDestroyed(this)) return;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onData
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
@action
@waitFor
async onData(data: EncryptedMessage) {
if (isDestroyed(this)) return;
Function isKeyMatchingVoteDiff
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private isKeyMatchingVoteDiff(vote: VoteChain): boolean {
if (!vote.previousVoteChain) {
return this.isProperMoveBase(vote);
}
Function getPoints
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getPoints(num: number) {
let viewportWidth = window.innerWidth;
let left = 0;
let right = viewportWidth;
let bottom = window.innerHeight;
Function stack
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
@action
stack() {
let cards = this.element.querySelectorAll('.playing-card');
let { path } = getPoints(cards.length);
Function markReadTask
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@task({ withTestWaiter: true })
async markReadTask() {
let attempts = 0;
while (attempts < 100) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;
Function isValidChain
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async isValidChain(channel: ChannelContextChain): Promise<boolean> {
let isFirstContextChain: boolean = !channel.previousChain && !channel.supportingVote;
if (isFirstContextChain) {
return this.isValidSingleChain(channel);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"