ifmeorg/ifme

View on GitHub

Showing 77 of 131 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<div
id="toast-notice"
aria-label={showNotice ? I18n.t('alert_auto_hide') : ''}
role="region"
aria-live="polite"
Severity: Major
Found in client/app/components/Toast/index.jsx and 1 other location - About 1 hr to fix
client/app/components/Toast/index.jsx on lines 81..106

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<div
id="toast-alert"
aria-label={showAlert ? I18n.t('alert_auto_hide') : ''}
role="alert"
className={`${
Severity: Major
Found in client/app/components/Toast/index.jsx and 1 other location - About 1 hr to fix
client/app/components/Toast/index.jsx on lines 51..80

Function useFocusTrap has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export const useFocusTrap = (
ref: { current: null | HTMLElement },
isOpen: boolean,
) => {
useEffect(() => {
Severity: Minor
Found in client/app/hooks/useFocusTrap.js - About 1 hr to fix

Function resolveElement has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const resolveElement = () => {
if (element) {
return (
<div
id={elementId}
Severity: Minor
Found in client/app/components/Modal/index.jsx - About 1 hr to fix

    Function useFocusTrap has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const useFocusTrap = (
    ref: { current: null | HTMLElement },
    isOpen: boolean,
    ) => {
    useEffect(() => {
    Severity: Minor
    Found in client/app/hooks/useFocusTrap.js - About 1 hr to fix

      Function Toast has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      export const Toast = ({ alert, notice, appendDashboardClass }: Props): Node => {
      const [showAlert, setShowAlert] = useState<boolean>(
      alert !== null
      && alert !== ''
      && !document.documentElement?.hasAttribute('data-turbolinks-preview'),
      Severity: Minor
      Found in client/app/components/Toast/index.jsx - About 1 hr to fix

      Method page_title has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def page_title
      t('app_name') +
      if sign_in_path?
      ' | ' + t('account.sign_in')
      elsif join_path?
      Severity: Minor
      Found in app/helpers/application_helper.rb - About 1 hr to fix

      Useless method definition detected.
      Open

      def destroy
      super
      end

      Rename is_checked to checked?.
      Open

      def is_checked(value)
      Severity: Minor
      Found in app/helpers/moments_helper.rb by rubocop

      Remove explicit presence validation for group_id.
      Open

      presence: true
      Severity: Minor
      Found in app/models/meeting.rb by rubocop

      Use atomic file operation method FileUtils.rm_f.
      Open

      File.delete(dr.file_path) if File.exist?(dr.file_path)
      Severity: Minor
      Found in app/models/user.rb by rubocop

      Parsing error: 'Const declarations' require an initialization value. (7:18)
      Open

      export const TYPES: string[] = REQUIRES_DEFAULT.concat([
      Severity: Minor
      Found in client/app/components/Input/utils.js by eslint

      Return false instead of nil in predicate methods.
      Open

      return if omniauth_avatar.nil?

      Remove explicit presence validation for group_id/user_id.
      Open

      validates :group_id, :user_id, presence: true
      Severity: Minor
      Found in app/models/group_member.rb by rubocop

      Prefer grep to select with a regexp match.
      Open

      resource['tags'].select do |tag|
      @moment_keywords.match?(tag)
      end

      Prefer string interpolation to string concatenation.
      Open

      ' | ' + t('account.sign_up')
      Severity: Minor
      Found in app/helpers/application_helper.rb by rubocop

      Rails.public_path is a Pathname so you can just append #read.
      Open

      File.read(Rails.public_path.join(webpack_folder, path))
      Severity: Minor
      Found in app/helpers/assets_helper.rb by rubocop

      Remove explicit presence validation for user_id.
      Open

      validates :user_id, :name, :description, presence: true
      Severity: Minor
      Found in app/models/moment_template.rb by rubocop

      Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
      Open

      %w[SECRET_KEY_BASE DEVISE_SECRET_KEY].each do |key|
      Severity: Minor
      Found in Rakefile by rubocop

      Parsing error: Unexpected token, expected "," (5:5)
      Open

      ref: { current: null | HTMLElement },
      Severity: Minor
      Found in client/app/hooks/useFocusTrap.js by eslint
      Severity
      Category
      Status
      Source
      Language