Showing 1,205 of 1,252 total issues
Function useTanStackTableBuilder
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
const useTanStackTableBuilder = <D extends object>(
props: TableTemplate<D>,
): TanStackTableProps<D> => {
const [columns, getRealColumn] = buildTanStackColumns(
props.columns,
- 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 EnrolRequestsTable
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
const EnrolRequestsTable: FC<Props> = (props) => {
const {
title,
enrolRequests,
pendingEnrolRequests = 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
Function ConvertMcqMrqPrompt
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
const ConvertMcqMrqPrompt = (props: ConvertMcqMrqPromptProps): JSX.Element => {
const { for: question } = props;
const { t } = useTranslation();
const [converting, setConverting] = useState(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
Function PendingTodosTable
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
const PendingTodosTable: FC<Props> = (props) => {
const { intl, todos, todoType } = props;
const [shavedTodos, setShavedTodos] = useState(todos.slice(0, 5));
const [end, setEnd] = useState(10);
- 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 VideoTable
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
const VideoTable: FC<Props> = (props) => {
const { videos, permissions, onTogglePublished, intl } = props;
const videoMetadata = useAppSelector(getVideoMetadata);
if (videos && videos.length === 0) {
- 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 reducer
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
const reducer = produce((state, action) => {
const { type } = action;
switch (type) {
case actionTypes.LOAD_OBJECTS_LIST_REQUEST: {
- Create a ticketCreate a ticket
Function NameDescriptionForm
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
const NameDescriptionForm = (props) => {
const { initialValues, onSubmit } = props;
const {
control,
handleSubmit,
- Create a ticketCreate a ticket
Function renderCommentContent
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderCommentContent = () => {
if (editMode) {
return (
<>
{renderRating()}
- Create a ticketCreate a ticket
Function Checkbox
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
(props, ref): JSX.Element => {
const {
component,
label,
dangerouslySetInnerHTML,
- Create a ticketCreate a ticket
Function Footer
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Footer = (): JSX.Element | null => {
const { t } = useTranslation();
const enabled = useFooter();
const attributions = useAttributions();
- Create a ticketCreate a ticket
Function DayView
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DayView = (): JSX.Element => {
const { t } = useTranslation();
const timelines = useAppSelector(selectTimelines);
const items = useAppSelector(selectItems);
- Create a ticketCreate a ticket
Function ForumPostResponseForm
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ForumPostResponseForm = <T extends 'new' | 'edit'>(
props: ForumPostResponseFormProps<T>,
): JSX.Element => {
const { with: data } = props;
- Create a ticketCreate a ticket
Function UserShow
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
const UserShow: FC<Props> = (props) => {
const { intl } = props;
const [isLoading, setIsLoading] = useState(true);
const { userId } = useParams();
- Create a ticketCreate a ticket
Function render
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
sections,
isLoading,
survey: { anonymous },
- Create a ticketCreate a ticket
Function initializeCanvas
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
initializeCanvas(answerId, imageUrl) {
this.image = new Image();
this.image.src = imageUrl;
this.image.onload = () => {
- Create a ticketCreate a ticket
Function render
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { topicPostPack, courseId, forumId } = this.props;
const selectedPostIds = new Set(
this.props.selectedPostPacks.map((pack) => pack.corePost.id),
);
- Create a ticketCreate a ticket
Function MaterialForm
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MaterialForm: FC<Props> = (props) => {
const { open, editing, onClose, onSubmit, title, initialValues } = props;
const { t } = useTranslation();
return (
- Create a ticketCreate a ticket
Function LearningRateRecordsChart
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LearningRateRecordsChart: FC<LearningRateRecordsChartProps> = (props) => {
const { learningRateRecords } = props;
const { t } = useTranslation();
const sortedRecords = useMemo(
- Create a ticketCreate a ticket
Class LearningMapController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Course::LearningMapController < Course::ComponentController
NODE_ID_DELIMITER = '-'
NEGATIVE_INF = -1_000_000_000
before_action :authorize_learning_map
- Create a ticketCreate a ticket
Function ResponseEdit
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ResponseEdit = (props) => {
const {
dispatch,
flags,
match: {
- Create a ticketCreate a ticket