Showing 287 of 1,075 total issues
Function isLookbehindSupported
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function isLookbehindSupported(): boolean {
const parser = new UAParser().getBrowser()
switch (parser.name) {
case 'IE':
Function useChart
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useChart = (
canvas: HTMLCanvasElement | null,
reputation: number[],
trackColor?: string
): Chart<'radar'> => {
Function TrackCard
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function TrackCard() {
return (
<div className="bg-backgroundColorA shadow-base rounded-8 flex gap-16 py-20 px-24">
<Skeleton.Shape shape="hex" style={{ width: 80, height: 80 }} />
<div className="flex flex-col w-100">
Method flash_messages
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def flash_messages(object = nil, html_messages: false)
tags = []
a = alert
n = notice
- 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
Method generic_nav
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def generic_nav(nav_title, submenu: nil, view: nil, path: nil, offset: 0, has_view: false, css_class: nil)
tag.li class: "nav-element #{css_class}" do
content = conditional_link(path) do
tag.span(nav_title, tabindex: path.nil? ? 0 : -1, role: 'none',
class: "nav-element-label #{path.nil? ? 'nav-element-focusable' : ''}")
- 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
Method contains_cycle?
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def self.contains_cycle?(adjacencies)
visited = Array.new(adjacencies.length).fill(false)
on_stack = Array.new(adjacencies.length).fill(false)
stack = []
- 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
Method time_ago_in_words
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def time_ago_in_words(time, short: false)
t = "#{super(time)}" # rubocop:disable Style/RedundantInterpolation Required to unfreeze string
t.gsub!(/^about /, '')
t.gsub!(/^almost /, '')
- 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
Method call
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def call
raise "Block must be given for sending" unless block_given?
# We start by doing checks to see if we should send based
# on the state of the emailable. We hope to catch things
- 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 StudentTooltip
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
>(({ endpoint, ...props }, ref) => {
const { data, error, status } = useRequestQuery<{ student: Student }>(
[endpoint],
{ endpoint: endpoint, options: {} }
)
- 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 TrackMenu
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export default function TrackMenu({
track,
links,
ariaHideApp = false,
}: {
- 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
Method categories_data
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def categories_data(track_id = 0)
metrics = {
publishing: publishing_metrics(track_id),
mentoring: mentoring_metrics(track_id),
authoring: authoring_metrics(track_id),
Function useList
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useList(initialRequest: Request): {
request: ListState
setCriteria: (criteria: string) => void
setOrder: (order: string) => void
setPage: (page: number, key?: string) => void
Function computePathProperties
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function computePathProperties(
pathStartElement: HTMLElement,
pathEndElement: HTMLElement
): ConceptPathProperties {
const course = getPathCourse(pathStartElement, pathEndElement)
Function Button
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Button = (props: Props & { className?: string }) => {
switch (props.status) {
case 'locked':
return props.editorEnabled ? (
<div className={props.className}>Open in editor</div>
Function onGoogleTranslateDetected
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onGoogleTranslateDetected(): void {
// See: https://github.com/facebook/react/issues/11538#issuecomment-417504600
if (typeof Node === 'function' && Node.prototype) {
const originalRemoveChild: (child: Node) => Node =
Node.prototype.removeChild
Function smoothDataPoints
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const smoothDataPoints = (
dataPoints: DataPoint[],
height: number
): DataPoint[] => {
return dataPoints.reduce(
- 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 ExerciseCompletedModal
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const ExerciseCompletedModal = ({
open,
completion,
...props
}: {
- 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 reducer
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function reducer(state: State, action: Action): State {
switch (action.type) {
case 'avatar.uploaded':
return {
imageToCrop: null,
Function Steps
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Steps() {
const { send, currentState } = useContext(TrackContext)
switch (currentState.value as StateValue) {
case 'hasLearningMode':
Method git_filepath
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def git_filepath(field, file:, append_file: nil)
if file.instance_of?(Proc)
read_method = "read_text_blob"
else
json_file = file.end_with?('.json')