Showing 720 of 1,785 total issues
Function expandTimeline
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function expandTimeline(timelineId, path, params = {}, done = noOp) {
return (dispatch, getState) => {
const timeline = getState().getIn(['timelines', timelineId], ImmutableMap());
const isLoadingMore = !!params.max_id;
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { src, width, height, alt } = this.props;
const { loading } = this.state;
return (
Function expandNormalizedNotifications
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const expandNormalizedNotifications = (state, notifications, next, isLoadingRecent, usePendingItems) => {
const lastReadId = state.get('lastReadId');
let items = ImmutableList();
notifications.forEach((n, i) => {
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { value, intl } = this.props;
const { open, placement } = this.state;
const valueOption = this.options.find(item => item.value === value);
Function push_subscriptions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function push_subscriptions(state = initialState, action) {
switch(action.type) {
case STORE_HYDRATE: {
const push_subscription = action.state.get('push_subscription');
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { isPollMultiple, title, index, autoFocus, intl } = this.props;
return (
<li>
Method remotable_attachment
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def remotable_attachment(attachment_name, limit, suppress_errors: true, download_on_assign: true, attribute_name: nil)
attribute_name ||= "#{attachment_name}_remote_url".to_sym
define_method("download_#{attachment_name}!") do |url = nil|
url ||= self[attribute_name]
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength } = this.props;
const { suggestionsHidden } = this.state;
return (
Function renderVideo
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderVideo () {
const { card, intl } = this.props;
const content = { __html: this.addAutoPlay(card.get('html')) };
const { width } = this.state;
const ratio = card.get('width') / card.get('height');
Function onChange
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onChange (path, checked) {
if (path[0] === 'push') {
if (checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') {
dispatch(requestBrowserPermission((permission) => {
if (permission === 'granted') {
Method update_count!
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def update_count!(key, value)
raise ArgumentError, "Invalid key #{key}" unless ALLOWED_COUNTER_KEYS.include?(key)
raise ArgumentError, 'Do not call update_count! on dirty objects' if association(:account_stat).loaded? && account_stat&.changed? && account_stat.changed_attribute_names_to_save == %w(id)
value = value.to_i
Method calculate_scores
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def calculate_scores(preview_cards, at_time)
global_items = []
locale_items = Hash.new { |h, key| h[key] = [] }
preview_cards.each do |preview_card|
Function conversations
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function conversations(state = initialState, action) {
switch (action.type) {
case CONVERSATIONS_FETCH_REQUEST:
return state.set('isLoading', true);
case CONVERSATIONS_FETCH_FAIL:
Method process_update
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def process_update
user.settings['notification_emails'] = merged_notification_emails if change?('notification_emails')
user.settings['interactions'] = merged_interactions if change?('interactions')
user.settings['default_privacy'] = default_privacy_preference if change?('setting_default_privacy')
user.settings['default_sensitive'] = default_sensitive_preference if change?('setting_default_sensitive')
Method call
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def call(username, domain, json, options = {})
return if json['inbox'].blank? || unsupported_uri_scheme?(json['id']) || domain_not_allowed?(domain)
@options = options
@json = json
Method klass
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def klass
case @json['type']
when 'Create'
ActivityPub::Activity::Create
when 'Announce'
Method perform
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def perform
# Maintaining a materialized view speeds-up subsequent queries significantly
AccountSummary.refresh
FollowRecommendation.refresh
Function handleTranslationClick
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleTranslationClick = useCallback(async (event) => {
event.preventDefault();
const translationServiceEndpoint = '/translation/';
if (hideTranslation && translation === undefined) {
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { suggestions, isLoading } = this.props;
return (
<Column>
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { intl, accountIds, multiColumn } = this.props;
if (!accountIds) {
return (