Showing 1,205 of 1,252 total issues
Function VideoShow
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const VideoShow: FC<Props> = (props) => {
const { intl } = props;
const { videoId } = useParams();
const [isLoading, setIsLoading] = useState(true);
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function VideoSubmissionShow
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const VideoSubmissionShow: FC<Props> = (props) => {
const { intl } = props;
const { submissionId } = useParams();
const [isLoading, setIsLoading] = useState(true);
const [videoSubmission, setVideoSubmission] = useState<VideoSubmissionData>();
- Create a ticketCreate a ticket
Function ReevaluateButton
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ReevaluateButton: FC<Props> = (props) => {
const { t } = useTranslation();
const { questionId } = props;
const assessment = useAppSelector(getAssessment);
- Create a ticketCreate a ticket
Function PackageDetails
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PackageDetails = (props: PackageDetailsProps): JSX.Element | null => {
const { t } = useTranslation();
const { question, packageUi } = useProgrammingFormDataContext();
if (!question.package) return null;
- Create a ticketCreate a ticket
Function LandingPage
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LandingPage = (): JSX.Element => {
const { t } = useTranslation();
const auth = useAuthAdapter();
return (
- Create a ticketCreate a ticket
Function MuiFilterMenu
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const MuiFilterMenu = (props: FilterProps): JSX.Element => {
const { filters } = props;
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function InstanceForm
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InstanceForm: FC<Props> = (props) => {
const { open, onClose, onSubmit } = props;
const { t } = useTranslation();
return (
- Create a ticketCreate a ticket
Class TestCase
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class TestCase
attr_reader :test_suite
# Creates a new test case. This represents a \<testcase> element.
#
- Create a ticketCreate a ticket
Function default
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (state = initialState, action) {
switch (action.type) {
case actions.SAVE_GRADE_SUCCESS: {
const initialValues = convertAnswersDataToInitialValues(
action.payload.answers,
- Create a ticketCreate a ticket
Function CourseUserProgress
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CourseUserProgress = (props: CourseUserProgressProps): JSX.Element => {
const { from: data } = props;
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function NewCourseForm
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const NewCourseForm: FC<Props> = (props) => {
const { open, title, onClose, initialValues, onSubmit } = props;
const { t } = useTranslation();
return (
- Create a ticketCreate a ticket
Function PersonalTimesTable
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PersonalTimesTable: FC<Props> = (props) => {
const { personalTimes, intl } = props;
const renderRow = (item: PersonalTimeMiniEntity): JSX.Element => {
return (
- Create a ticketCreate a ticket
Function UserManagementButtons
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UserManagementButtons: FC<Props> = (props) => {
const { intl, user } = props;
const dispatch = useAppDispatch();
const [isDeleting, setIsDeleting] = useState(false);
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function AssessmentsIndex
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AssessmentsIndex = (): JSX.Element => {
const [params, setParams] = useSearchParams();
const categoryId = parseInt(params.get('category') ?? '', 10) || undefined;
const tabId = parseInt(params.get('tab') ?? '', 10) || undefined;
- Create a ticketCreate a ticket
Function PostPack
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PostPack: FC<Props> = (props) => {
const { postPack } = props;
const courseId = getCourseId();
const [isExpanded, setIsExpanded] = useState(false);
- Create a ticketCreate a ticket
Function QuestionFormOptions
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const QuestionFormOptions = (props) => {
const {
fieldsConfig,
disabled,
multipleChoice,
- Create a ticketCreate a ticket
Function render
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
creator: { name, imageUrl },
createdAt,
canUpdate,
- Create a ticketCreate a ticket
Function customBodyRenderLite
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
customBodyRenderLite: (dataIndex): JSX.Element | null => {
const topic = forumTopics[dataIndex];
const firstPostCreator = topic.firstPostCreator;
const postCreatorObject =
firstPostCreator &&
- Create a ticketCreate a ticket
Method update_todo
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
def update_todo
return unless todo
if attempting?
todo.update_attribute(:workflow_state, 'in_progress') unless todo.in_progress?
- 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 renderTestCases
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
renderTestCases(testCases, testCaseType, warn, isDraftAnswer) {
const {
collapsible,
testCases: { canReadTests },
graderView,
- 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"