Showing 451 of 1,081 total issues
Function BackgroundAsset
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function BackgroundAsset(props) {
const backgroundFile = useBackgroundFile({
file: props.backdrop.video || props.backdrop.image,
motifArea: props.backdrop.motifArea,
effects: props.backdrop.effects,
Function WaveformPlayerControls
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function WaveformPlayerControls(props) {
const darkBackground = useDarkBackground();
const theme = useTheme();
return (
Method build
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build(account)
embedded_index_table(account.memberships.on_accounts.includes(:user)
.accessible_by(current_ability, :index)
.where('pageflow_memberships.user_id IS NOT NULL'),
blank_slate_text: I18n.t('pageflow.admin.accounts.no_members')) do
Function asyncPlay
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const asyncPlay = function(player) {
var originalPlay = player.play;
var originalPause = player.pause;
var intendingToPlay = false;
Function createMediaPlayer
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createMediaPlayer = function (options) {
let isAudio = options.tagName == 'AUDIO';
const player = new VideoPlayer(options.mediaElement, {
controlBar: false,
Function Heading
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function Heading({configuration, sectionProps, contentElementWidth}) {
const level = configuration.level || sectionProps.sectionIndex;
const firstSectionInEntry = level === 0;
const updateConfiguration = useContentElementConfigurationUpdate();
const {t} = useI18n({locale: 'ui'});
- Read upRead up
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 updatePlayerState
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function updatePlayerState(player, prevPlayerState, playerState, playerActions){
if (!prevPlayerState.shouldPrebuffer && playerState.shouldPrebuffer) {
player.prebuffer().then(() => setTimeout(playerActions.prebuffered, 0));
}
- Read upRead up
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 InlineAudio
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function InlineAudio({contentElementId, configuration}) {
const audioFile = useFileWithInlineRights({
configuration,
collectionName: 'audioFiles',
propertyName: 'id',
- Read upRead up
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 build
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def build(user)
embedded_index_table(user.memberships.on_entries
.includes(:entry, entry: :account).references(:pageflow_entries)
.accessible_by(current_ability, :index),
blank_slate_text: t('pageflow.admin.users.no_entries')) do
- Read upRead up
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_files
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def create_files(draft_entry, file_type, file_data_by_name, skip_encoding = false)
file_data_by_name.transform_values do |data|
say(" creating #{file_type} file from #{data['url']}")
file_state = %i[image text_track].include?(file_type) ? 'processed' : 'uploading'
- Read upRead up
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 constructor
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props, context) {
super(props, context);
this.state = {
subMenuVisible: false
Function DelayedStart
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const DelayedStart = (function($) {
return function() {
var waitDeferred = new $.Deferred();
var promises = [];
var performed = false;
Function updatePoints
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updatePoints(state, index, position, selectionPosition) {
if (state.mode === 'polygon') {
return {
...state,
points: [
Function MediaPage
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function MediaPage(props) {
const page = props.page;
const playerState = props.playerState;
const infoBox = {
Function MediaPlayerControls
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function MediaPlayerControls(props) {
const playerState = props.playerState;
const playerActions = props.playerActions;
const {t} = useI18n();
Function configurationEditor
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
configurationEditor({entry}) {
this.listenTo(this.model, 'change:hyphens', this.refresh);
const modelDelegator = entry.createLegacyTypographyVariantDelegator({
model: this.model,
Function renderDropTargets
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderDropTargets(targets, contentElementId) {
function handleDrop(item, index) {
if (index === 0) {
postMoveContentElementMessage({
id: item.id,
Function buildEntry
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildEntry(entry, contentElement, item, getPreviewConfiguration) {
const section = contentElement.section;
const fakeContentElement = new Backbone.Model(
contentElement.attributes,
Method sample_scrolled_entry
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sample_scrolled_entry(attributes:, options: {})
entry = Pageflow::Entry.where(type_name: 'scrolled')
.where(attributes.slice(:account, :title))
.first
Function insertContentElement
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
insertContentElement(attributes, {id, at, splitPoint}) {
if (at === 'backdropOfSection') {
const section = this.sections.get(id)
const contentElement = this.insertContentElement(