Showing 451 of 1,081 total issues
Function ProgressIndicators
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function ProgressIndicators({currentTime, duration, bufferedEnd, scrubTo, seekTo}) {
const {t} = useI18n();
const [dragging, setDragging] = useState();
const progressBarsContainerWidth = useRef();
- 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 createLegacyTypographyVariantDelegator
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
createLegacyTypographyVariantDelegator({
model, paletteColorPropertyName
}) {
const delegator = Object.create(model)
const mapping = this.scrolledSeed.legacyTypographyVariants;
- 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 add
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
add: function(upload, options) {
options = options || {};
var editor = options.editor || editorApi;
var fileType = this.fileTypes.findByUpload(upload);
var file = new fileType.model({
- 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 getMotifAreaPadding
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function getMotifAreaPadding(
contentRequiresPadding, transitions, motifAreaDimension, backdropContentElement, empty
) {
if (backdropContentElement) {
if (transitions[0] === 'fadeIn' || (empty && transitions[1] === 'fadeOut')) {
- 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 withBlockNormalization
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function withBlockNormalization({onlyParagraphs}, editor) {
if (!onlyParagraphs) {
return editor;
}
- 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 set
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
set: function(name, value) {
let attrs;
if (typeof name === 'object') {
attrs = name;
- 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 setItemCookieStringWithOptions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function setItemCookieStringWithOptions(key, value, {expires, path, domain, secure, sameSite}) {
let expiresPart = "";
if (expires) {
switch (expires.constructor) {
- 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 10 (exceeds 5 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
- 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 interval
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const interval = function(player) {
const originalVolume = player.volume;
let fadeVolumeResolve;
let fadeVolumeInterval;
- 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 validate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
validate: function(success) {
var view = this;
var options = this.options;
var value = this.ui.input.val();
- 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 page_css_class
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def page_css_class(page)
classes = ['page']
classes << 'invert' if page.configuration['invert']
classes << 'hide_title' if page.configuration['hide_title']
classes << "text_position_#{page.configuration['text_position']}" if page.configuration['text_position'].present?
- 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 default
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function() {
const initialState = {
uiVisible: false,
requestedVendors: []
};
Function onShow
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
onShow: function() {
var slideshow = this.slideshow = Slideshow.setup({
element: this.ui.entry,
enabledFeatureNames: this.model.get('enabled_feature_names'),
simulateHistory: true
Function _create
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create: function() {
var slideshow = this.options.slideshow,
that = this;
slideshow.on('pageactivate', function(event, options) {
Function start
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const start = useCallback(function() {
let viewer = viewerRef.current;
let start = new Date().getTime();
let pitch = viewer.getPitch();
Function toolbarButtons
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function toolbarButtons(t) {
return [
{
name: 'paragraph',
text: t('pageflow_scrolled.inline_editing.formats.paragraph'),
Function set
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
set(name, value, options) {
const previousValue = this.get('position');
Configuration.prototype.set.apply(this, arguments);
Function useConsentRequested
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useConsentRequested() {
const consent = useContext(ConsentContext);
const [request, setRequest] = useState({});
useIsomorphicLayoutEffect(() => {
Function update
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function() {
if (this.model) {
if (_.isFunction(this.model.thumbnailFile)) {
var file = this.model && this.model.thumbnailFile();
Function filterSources
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const filterSources = function(playerElement) {
if (playerElement.tagName.toLowerCase() !== 'video') {
return playerElement;
}