Showing 407 of 1,024 total issues
Function Content
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const Content = withInlineEditingDecorator('ContentDecorator', function Content(props) {
const [currentSectionIndex, setCurrentSectionIndexState] = useCurrentSectionIndexState();
const entryStructure = useEntryStructure();
useSectionChangeEvents(currentSectionIndex);
- 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 useTextTracks
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function useTextTracks({file, defaultTextTrackFilePermaId, captionsByDefault}) {
let [setting, setSetting] = useSetting('textTrack');
setting = setting || {};
const {t} = useI18n();
- 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 placeholderText
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
placeholderText: function() {
if (!this.isDisabled() || !this.options.hidePlaceholderIfDisabled) {
if (this.options.placeholder) {
if (typeof this.options.placeholder == 'function') {
return this.options.placeholder(this.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 LinkTooltipProvider
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function LinkTooltipProvider({editor, disabled, position, children}) {
const [state, setState] = useState();
const outerRef = useRef();
const update = useMemo(() => {
- 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 update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
update: function() {
var view = this;
if (this.model.get('checking')) {
view.ui.state.text(I18n.t('pageflow.editor.quotas.loading'));
- 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 update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
update: function() {
if (this.videoPlayer.isPresent() && this.model.hasChanged(this.options.propertyName)) {
var paused = this.videoPlayer.paused();
this.videoPlayer.src(this.model.getVideoFileSources(this.options.propertyName));
- 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 onRender
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
onRender: function() {
var view = this,
options = this.options;
SelectInputView.prototype.onRender.apply(this, arguments);
- 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 deepEqual
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function deepEqual(a, b) {
if (a.length !== b.length) {
return false;
}
- 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 ScrollButton
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function ScrollButton({type, contentRect, onStep}) {
const visible = type === 'start' ? contentRect.scroll.left > 0 :
contentRect.scroll.width > contentRect.client.width &&
contentRect.scroll.left < contentRect.scroll.width - contentRect.client.width;
const step = type === 'start' ? -100 : 100;
- 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 bufferUnderrunWaiting
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const bufferUnderrunWaiting = function(player) {
var originalPause = player.pause;
player.pause = function() {
cancelWaiting();
- 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 rewrite_file_references!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def rewrite_file_references!(hash, keys, files_by_name)
return unless hash
keys.each do |key|
next unless hash[key]
- 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 volumeBinding
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const volumeBinding = function(player, settings, options) {
options = options || {};
var originalPlay = player.play;
var originalPause = player.pause;
- 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 require
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
require(vendorName) {
if (this.inEditor) {
return Promise.resolve('fulfilled');
}
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def build(user, parent, entity_type)
if parent.is_a?(User)
button_label = I18n.t("pageflow.admin.#{entity_type}.add")
path = new_admin_user_membership_path(
parent, entity_type: to_class_name(entity_type)
- 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 find_thumbnail
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def find_thumbnail
candidates.detect do |candidate|
condition = candidate[:unless] || candidate[:if]
next if condition && !condition_met?(condition, candidate[:unless])
- 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 _create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_create: function() {
var player = this.options.player;
var playButton = this.element.find('.vjs-play-control');
var progressHolder = this.element.find('.vjs-progress-holder');
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function(collectionName, {itemSaga, middleware}) {
const itemsSelector = createItemsSelector(collectionName);
return saga;
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function(collectionName) {
const itemScopeProperty = getItemScopeProperty(collectionName);
return function connectInItemScope(mapStateToProps, mapDispatchToProps, mergeProps) {
const connecter = connect(
- 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 getAttributes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getAttributes(model, {attributeNames, includeConfiguration}) {
const result = attributeNames.reduce((result, attributeName) => {
if (typeof attributeName == 'object') {
const key = Object.keys(attributeName)[0];
const value = attributeName[key];
- 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 useIntersectionObserver
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function useIntersectionObserver({threshold, onVisibleIndexChange}) {
const containerRef = useRef();
const childRefs = useRef([]);
const observerRef = 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"