WikiEducationFoundation/WikiEduDashboard

View on GitHub

Showing 462 of 1,666 total issues

Function link_open has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    md.renderer.rules.link_open = function (tokens, idx, options, env, self) {
Severity: Minor
Found in app/assets/javascripts/utils/markdown_it.js - About 35 mins to fix

    Function requestNewAccount has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      async requestNewAccount(passcode, courseSlug, username, email, createAccountNow) {
    Severity: Minor
    Found in app/assets/javascripts/utils/api.js - About 35 mins to fix

      Function setValidation has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      const setValidation = function (key, valid, message, changed = true, state) {
      Severity: Minor
      Found in app/assets/javascripts/reducers/validations.js - About 35 mins to fix

        Function defaultRender has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            const defaultRender = md.renderer.rules.link_open || function (tokens, idx, options, env, self) {
        Severity: Minor
        Found in app/assets/javascripts/utils/markdown_it.js - About 35 mins to fix

          Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def initialize(current, past, submitted, strictly_current, current_user)
          Severity: Minor
          Found in app/presenters/dashboard_presenter.rb - About 35 mins to fix

            Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def initialize(course, title, talk_title, assignments, templates)
            Severity: Minor
            Found in lib/wiki_assignment_output.rb - About 35 mins to fix

              Method email has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def email(course, staffer, adder, new_instructor, courses_user)
              Severity: Minor
              Found in app/mailers/new_instructor_enrollment_mailer.rb - About 35 mins to fix

                Function notifications has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export default function notifications(state = initialState, action) {
                  switch (action.type) {
                    case ADD_NOTIFICATION: {
                      const newState = [...state, action.notification];
                
                
                Severity: Minor
                Found in app/assets/javascripts/reducers/notifications.js - About 35 mins to fix

                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 handleParentConditionalChange has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  handleParentConditionalChange(value, conditionalGroup, $parent) {
                    let { currentAnswers } = conditionalGroup;
                    let conditional;
                    // let resetQuestions = false;
                
                
                Severity: Minor
                Found in app/assets/javascripts/surveys/modules/Survey.js - About 35 mins to fix

                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 users has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export default function users(state = initialState, action) {
                  switch (action.type) {
                    case RECEIVE_USERS: {
                      // Transform the 'real_name' for users in 'action' into separate 'first_name'
                      // and 'last_name' properties if 'real_name' is available by using transformUsers.
                Severity: Minor
                Found in app/assets/javascripts/reducers/users.js - About 35 mins to fix

                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 validateCurrentQuestion has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  validateCurrentQuestion(e) {
                    e.preventDefault();
                    const $target = $(e.target);
                    const $block = $target.parents('.block');
                    this.$currentBlock = $block;
                Severity: Minor
                Found in app/assets/javascripts/surveys/modules/Survey.js - About 35 mins to fix

                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 PaginatedArticleControls has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export const PaginatedArticleControls = ({ showMore, limitReached }) => {
                  const dispatch = useDispatch();
                
                  const handlePageChange = ({ selected }) => {
                    dispatch({ type: SET_ARTICLES_PAGE, page: selected + 1 });
                Severity: Minor
                Found in app/assets/javascripts/components/articles/PaginatedArticleControls.jsx - About 35 mins to fix

                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 ModuleStatus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export const ModuleStatus = ({
                  block_id, course, deadline_status, due_date, flags, kind, module_progress, progressClass, slug,
                  complete, fetchExercises, incomplete
                }) => {
                  const isTrainingModule = kind === TRAINING_MODULE_KIND;

                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 render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  render() {
                    const panelCount = this.props.panels.length;
                    const panels = this.props.panels.map((panel, i) => {
                      const active = this.props.activePanelIndex === i;
                      const stepNumber = i + 1;
                Severity: Minor
                Found in app/assets/javascripts/components/wizard/wizard.jsx - About 35 mins to fix

                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 Alert has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                const Alert = ({ alert, adminAlert, resolveAlert }) => {
                  let resolveCell;
                  let alertTypeCell;
                
                  if (adminAlert) {
                Severity: Minor
                Found in app/assets/javascripts/components/alerts/alert.jsx - About 35 mins to fix

                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 CampaignOresPlot has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                const CampaignOresPlot = (props) => {
                  const [show, setShow] = useState(false);
                  const [loading, setLoading] = useState(true);
                  const [filePath, setFilePath] = useState(null);
                
                
                Severity: Minor
                Found in app/assets/javascripts/components/campaign/campaign_ores_plot.jsx - About 35 mins to fix

                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 validate_date_attribute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def validate_date_attribute(date_type)
                    value = send("#{date_type}_before_type_cast")
                    self[date_type] = value.is_a?(Date) || value.is_a?(Time) ? value : Time.zone.parse(value)
                    if self[date_type].nil?
                      errors.add(date_type, I18n.t('error.invalid_date', key: date_type.capitalize))
                Severity: Minor
                Found in app/models/campaign.rb - About 35 mins to fix

                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 create_alerts_for_active_courses has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def create_alerts_for_active_courses
                    @courses.each do |course|
                      next unless nontrivial_mainspace_activity?(course)
                      next if Alert.exists?(course_id: course.id, type: 'SandboxedCourseMainspaceAlert')
                      alert = Alert.create(type: 'SandboxedCourseMainspaceAlert',
                Severity: Minor
                Found in lib/alerts/sandboxed_course_mainspace_monitor.rb - About 35 mins to fix

                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 TagEditable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                const TagEditable = ({ course_id }) => {
                  const availableTags = useSelector(state => getAvailableTags(state));
                  const tags = useSelector(state => state.tags.tags);
                  const dispatch = useDispatch();
                
                
                Severity: Minor
                Found in app/assets/javascripts/components/overview/tag_editable.jsx - About 35 mins to fix

                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 TicketsHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                const TicketsHandler = () => {
                  const [page, setPage] = useState(0);
                  const [mode, setMode] = useState('filter');
                  const [searchQuery, setSearchQuery] = useState({ by_email_or_username: '', in_subject: '', in_content: '', by_course: '', });
                
                
                Severity: Minor
                Found in app/assets/javascripts/components/tickets/tickets_handler.jsx - About 35 mins to fix

                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

                Severity
                Category
                Status
                Source
                Language