Showing 451 of 1,081 total issues
Function Audio
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Audio = function(options) {
this.getSources = options.getSources || function(audioFileId) {
return options.audioFiles[audioFileId] || '';
};
Function handleFailedPlay
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const handleFailedPlay = function(player, options) {
var originalPlay = player.play;
player.play = function(/* arguments */) {
var result = originalPlay.apply(player, arguments);
Function setup
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setup() {
const promise = new Promise((r) => resolve = r);
const consentApi = {
requested: async function() {
const {vendors} = await promise;
Function closestPointOnPolygon
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function closestPointOnPolygon(polygon, c, maxDistance = 5) {
function distance(p1, p2) {
return Math.sqrt((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2);
}
Function default
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function*(options = {}) {
const sagas = [
togglePlaying(),
muteBackgroundMediaOnPlayFailed(),
disableScrollIndicatorDuringPlayback()
Function phoneLandscapeFullscreen
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const phoneLandscapeFullscreen = function() {
if (window.screen.orientation) {
if (browser.has('phone platform') && !browser.has('iphone platform')) {
window.screen.orientation.onchange = function() {
if (isLandscape()) {
Function onRender
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onRender: function () {
var configurationEditor = new ConfigurationEditorView({
model: this.model,
attributeTranslationKeyPrefixes: ['pageflow_scrolled.editor.content_elements.externalLinkList.attributes'],
tabTranslationKeyPrefix: 'pageflow_scrolled.editor.content_elements.externalLinkList.tabs'
Function steps
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const steps = useMemo(() => {
if (!enabled || !containerWidth) {
return;
}
Function scrollFromTo
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const scrollFromTo = useCallback((from, to) => {
const scroller = scrollerRef.current;
const step = scroller.children[to + 1];
scroller.scrollTo(Math.abs(scroller.offsetLeft - step.offsetLeft), 0);
Function initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initialize: function(attributes, options) {
this.options = options || {};
this.configuration = new FileConfiguration(
this.get('configuration') || {}
Function getAttributesFromBackdropAttribute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getAttributesFromBackdropAttribute() {
const backdrop = this.attributes.backdrop || {};
if (backdrop.image && backdrop.image.toString().startsWith('#')) {
return {
Function DefaultSelectionRect
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function DefaultSelectionRect(props) {
const {isSelected, select} = useContentElementEditorState();
const {t} = useI18n({locale: 'ui'});
const [, drag, preview] = useDrag({
Function getTypographyVariants
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getTypographyVariants({contentElement, prefix}) {
const typographyRuleNames = Object.keys(
this.scrolledSeed.config.theme.options.typography || {}
);
const legacyTypographyVariants = this.scrolledSeed.legacyTypographyVariants || {}
Function exampleSeed
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function exampleSeed() {
return normalizeAndMergeFixture({
sections: [
{
id: 1,
Function LegalInfoLink
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function LegalInfoLink(props) {
// eslint-disable-next-line no-script-url
if (props.url === 'javascript:pageflowDisplayPrivacySettings()' && props.label) {
return (
<div>
Function seekWithInvalidStateHandling
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const seekWithInvalidStateHandling = function(player) {
var originalSeek = player.seek;
player.seek = function(time) {
return retryOnProgress(function() {
Method smil_definitions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def smil_definitions
return [] if skip_smil
smil_definition = {
type: 'playlist',
Consider simplifying this complex logical expression. Open
Open
if (!this.isNew() &&
(!this.isDestroying || !this.isDestroying()) &&
(!this.isDestroyed || !this.isDestroyed()) &&
autoSave &&
options.autoSave !== false) {
Function default
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function(videoFile, fit, position, wrapperDimensions) {
if (!wrapperDimensions || !wrapperDimensions.height ||
!fit || fit == 'contain') {
return;
}
- 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 mapIndexOfRectHandleCrossingOver
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
function mapIndexOfRectHandleCrossingOver(index, position, startPoints) {
if ((index >= 0 && index <= 3 && position[1] > startPoints[0][1]) ||
(index >= 4 && index <= 6 && position[1] < startPoints[0][1])){
index = 6 - index;
}
- 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"