Showing 1,205 of 1,252 total issues
Function InviteUsers
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InviteUsers: FC<Props> = (props) => {
const { intl } = props;
const [isLoading, setIsLoading] = useState(true);
const invitations = useAppSelector(getAllInvitationsMiniEntities);
const permissions = useAppSelector(getManageCourseUserPermissions);
- Create a ticketCreate a ticket
Function VideosIndex
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VideosIndex: FC = () => {
const { t } = useTranslation();
const [isLoading, setIsLoading] = useState(true);
const [isOpen, setIsOpen] = useState(false);
const videoMetadata = useAppSelector(getVideoMetadata);
- Create a ticketCreate a ticket
Function LiveFeedbackButton
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LiveFeedbackButton: FC<Props> = (props) => {
const { t } = useTranslation();
const { questionId } = props;
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function ActionButtons
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ActionButtons = (props: ActionButtonsProps): JSX.Element => {
const { for: assessment, student } = props;
const { t } = useTranslation();
return (
- Create a ticketCreate a ticket
Function AssessmentBlockedByMonitorPage
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AssessmentBlockedByMonitorPage = (
props: AssessmentBlockedByMonitorPageProps,
): JSX.Element => {
const { for: assessment } = props;
- Create a ticketCreate a ticket
Function CoursesIndex
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CoursesIndex: FC<Props> = (props) => {
const { intl } = props;
const [isLoading, setIsLoading] = useState(false);
const [filter, setFilter] = useState({ active: false });
const courseCounts = useAppSelector(getAdminCounts);
- Create a ticketCreate a ticket
Function VisibleProgrammingImportEditor
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const VisibleProgrammingImportEditor = (props) => {
const {
answerId,
disabled,
dispatch,
- 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 update_submission
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def update_submission # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity, Metrics/MethodLength
@submission.class.transaction do
unless unsubmit? || unmark?
update_answers_params&.each do |answer_params|
next if !answer_params.is_a?(ActionController::Parameters) || answer_params[:id].blank?
- 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 CreateRenameTimelinePrompt
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const CreateRenameTimelinePrompt = (
props: CreateRenameTimelinePromptProps,
): JSX.Element => {
const { renames: timeline } = props;
- 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 Solution
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
(props, ref): JSX.Element => {
const { disabled, for: originalSolution } = props;
const [solution, setSolution] = useState(originalSolution);
const [toBeDeleted, setToBeDeleted] = 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 LeaderboardIndex
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const LeaderboardIndex: FC<Props> = (props) => {
const { intl } = props;
const dispatch = useAppDispatch();
const tabView = useMedia.MinWidth('lg');
const [isLoading, setIsLoading] = useState(true);
- 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 default
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (state = {}, action) {
switch (action.type) {
case actions.FETCH_SUBMISSION_SUCCESS:
case actions.FINALISE_SUCCESS:
case actions.UNSUBMIT_SUCCESS:
- Create a ticketCreate a ticket
Function MultipleFileInput
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MultipleFileInput: FC<Props> = (props) => {
const { intl, uploadedFiles, setUploadedFiles, disabled } = props;
const [dropZoneActive, setDropZoneActive] = useState(false);
- Create a ticketCreate a ticket
Function HorizontallyResizable
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const HorizontallyResizable = (
props: HorizontallyResizableProps,
): JSX.Element => {
const [resizingHandle, setResizingHandle] = useState<ResizeHandle>();
- Create a ticketCreate a ticket
Function VideoManagementButtons
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VideoManagementButtons: FC<Props> = (props) => {
const { video, navigateToIndex } = props;
const { t } = useTranslation();
const dispatch = useAppDispatch();
const navigate = useNavigate();
- Create a ticketCreate a ticket
Function Canvas
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Canvas = () => {
const transformRef = useRef(null);
const [scale, setScale] = useState(1);
const getGateInputId = (isSummaryGate, parentNodeId, childNodeId) =>
- Create a ticketCreate a ticket
Function renderUser
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderUser = () => {
const { unsubmitConfirmation, deleteConfirmation } = state;
const tableCenterCellStyle = {
...styles.tableCell,
...styles.tableCenterCell,
- Create a ticketCreate a ticket
Method answer_statistics_hash
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def answer_statistics_hash
submission_answer_statistics = Course::Assessment::Answer.find_by_sql(<<-SQL.squish
WITH
attempt_info AS (
SELECT
- Create a ticketCreate a ticket
Function VideosSettingsForm
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
const VideosSettingsForm = (props: VideosSettingsFormProps): JSX.Element => {
const { t } = useTranslation();
return (
<Form
- Create a ticketCreate a ticket
Function TargetsList
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TargetsList = (props: TargetsListProps): JSX.Element => {
const { containing: keyword, for: question } = props;
const { t } = useTranslation();
const targets = useMemo(() => filter(keyword, question), [keyword, question]);
- Create a ticketCreate a ticket