Showing 25 of 25 total issues
Function runSDK
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
const runSDK = ({ baseUrl, websiteToken }) => {
if (window.$chatwoot) {
return;
}
- 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 classHelper
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const classHelper = (classes, action, elm) => {
let search;
let replace;
let i;
let has = false;
- 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
Method find_all
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_all(name, prefix = nil, partial = false, details = {}, key = nil, locals = [])
- Create a ticketCreate a ticket
Method perform
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def perform
message = event_data[:message]
return if message.private?
return unless processable_message?(message)
return unless message.conversation.pending?
- 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
Method create_test_text
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_test_text
messenger_channel = Channel::FacebookPage.last
@inbox = ::Inbox.find_by(channel: messenger_channel)
return unless @inbox
- 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
Method contact_params
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def contact_params
begin
k = Koala::Facebook::API.new(@inbox.channel.page_access_token) if @inbox.facebook?
result = k.get_object(@sender_id) || {}
rescue Koala::Facebook::AuthenticationError
- 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 conversationUrl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const conversationUrl = ({
accountId,
activeInbox,
id,
label,
- 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
Expected item on line 5 to appear before line 4. Rule sets should be ordered as follows: @extends
, @includes
without @content
, properties, @includes
with @content
, nested rule sets Open
@include custom-border-top(3px, transparent);
- Create a ticketCreate a ticket
- Exclude checks
Use //
comments everywhere Open
/* Enter and leave animations can use different */
- Create a ticketCreate a ticket
- Exclude checks
Color literals like rgba(0, 0, 0, 0.1)
should only be used in variable declarations; they should be referred to via variable everywhere else. Open
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
- Create a ticketCreate a ticket
- Exclude checks
Each selector in a comma sequence should be on its own single line Open
&.disabled:focus, &[disabled]:focus {
- Create a ticketCreate a ticket
- Exclude checks
Expected item on line 4 to appear before line 3. Rule sets should be ordered as follows: @extends
, @includes
without @content
, properties, @includes
with @content
, nested rule sets Open
@include flex-align($x: center, $y: middle);
- Create a ticketCreate a ticket
- Exclude checks
Properties should be ordered opacity, transform Open
transform: translateY(-$space-small);
- Create a ticketCreate a ticket
- Exclude checks
0px
should be written without units as 0
Open
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
- Create a ticketCreate a ticket
- Exclude checks
Each selector in a comma sequence should be on its own single line Open
&.disabled, &[disabled],
- Create a ticketCreate a ticket
- Exclude checks
Each selector in a comma sequence should be on its own single line Open
&:hover, &:focus {
- Create a ticketCreate a ticket
- Exclude checks
Properties should be ordered color, font-size Open
font-size: $font-size-default;
- Create a ticketCreate a ticket
- Exclude checks
Use //
comments everywhere Open
/* durations and timing functions. */
- Create a ticketCreate a ticket
- Exclude checks
Properties should be ordered opacity, transform Open
transform: translateY(-$space-medium);
- Create a ticketCreate a ticket
- Exclude checks
Properties should be ordered align-items, color, display, font-size, font-weight Open
font-size: $font-size-small;
- Create a ticketCreate a ticket
- Exclude checks