Showing 287 of 1,075 total issues
Method call
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call
{
id: solution.id,
last_iterated_at: solution.last_iterated_at,
published_at: solution.published_at,
Function useTheme
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useTheme(
defaultThemePreference: string,
links: Pick<ThemePreferenceLinks, 'update'>
): useThemeReturns {
const [hasBeenUpdated, setHasBeenUpdated] = useState(false)
Method show
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def show
begin
solution = Solution.find_by!(uuid: params[:solution_id])
rescue ActiveRecord::RecordNotFound
return render_solution_not_found
- 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 SplitPane
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const SplitPane = ({
id,
left,
right,
className = '',
- 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 useDropdown
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const useDropdown = (
itemLength: number,
onItemSelect?: (index: number) => void,
panelOptions?: any
): DropdownAttributes => {
- 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 TestRunSummaryContent
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const TestRunSummaryContent = ({
testRun,
testRunner,
onSubmit,
isSubmitDisabled,
- 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 useItemList
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const useItemList = <T extends ListItemType>(cacheKey: QueryKey) => {
const queryClient = useQueryClient()
const [editingItem, setEditingItem] = useState<T | null>(null)
const handleEdit = useCallback((item) => {
- 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 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call
return if iteration.blank?
return deleted_version if iteration.deleted?
{
Function handleItemKeyDown
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleItemKeyDown = (e: React.KeyboardEvent, index: number) => {
switch (e.key) {
case 'ArrowDown':
e.preventDefault()
setFocusIndex((index + itemLength + 1) % itemLength)
Method track
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def track
track = Track.find(params[:track_id])
pages = []
pages << [track_url(track), track.updated_at, :monthly, 0.9]
pages << [track_concepts_url(track), track.updated_at, :monthly, 0.85] if track.course?
Method call
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call
{
uuid: solution.uuid,
snippet: solution.snippet,
num_views: solution.num_views,
Function reducer
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const reducer: Reducer<ListState, ListAction> = (
state: ListState,
action: ListAction
) => {
switch (action.type) {
Method to_s
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_s
super("community-solutions-comments-list", {
user_signed_in: current_user.present?,
allow_comments: solution.allow_comments,
is_author: current_user == solution.user,
Method learning_tracks_data
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def learning_tracks_data
user.user_tracks.includes(:track).map do |user_track|
track = user_track.track
first_completion = user_track.exercise_completion_dates.min
Function initEventListeners
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initEventListeners() {
// As we have conditional stylesheets per page, we need to extract and
// render those when the frame changes. We want the CSS to load BEFORE
// then HTML renders, so we get any stylesheets downloaded and THEN render
// continnue processing the frame render.
Function useMentoringRequest
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useMentoringRequest(
links: { createMentorRequest: string },
onSuccess: (mentorRequest: MentorSessionRequest) => void
): {
handleSubmit: (e: React.FormEvent<HTMLFormElement>) => void
Function ResultsZone
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ResultsZone = (
props: React.PropsWithChildren<{
isFetching: boolean
className?: string | null
}>
Method call
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def call
# Sometimes the iteration might be deleted
# before we get to the job. There *shouldn't* be
# a DB race condition because of the way this is called
# in Iteration::Create but if we see missing snippets,
- 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 useStripeForm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function useStripeForm({
captchaRequired,
paymentIntentType,
amount,
confirmParamsReturnUrl,
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
def call
source_submission_hash = solution_files_hash(representation.source_submission)
example_submissions = { source_submission_hash => representation.source_submission }
MAX_PAGES_FETCHED.times do |page|
- 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"