Showing 425 of 1,055 total issues
Function closestPointOnPolygon
has 26 lines of code (exceeds 25 allowed). Consider refactoring. 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 getAttributesFromBackdropAttribute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getAttributesFromBackdropAttribute() {
const backdrop = this.attributes.backdrop || {};
if (backdrop.image && backdrop.image.toString().startsWith('#')) {
return {
Function getTypographyVariants
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getTypographyVariants({contentElement, prefix}) {
const typographyRuleNames = Object.keys(
this.scrolledSeed.config.theme.options.typography || {}
);
const legacyTypographyVariants = this.scrolledSeed.legacyTypographyVariants || {}
Function initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function(attributes, options) {
this.options = options || {};
this.configuration = new FileConfiguration(
this.get('configuration') || {}
Function exampleSeed
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function exampleSeed() {
return normalizeAndMergeFixture({
sections: [
{
id: 1,
Function DefaultSelectionRect
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DefaultSelectionRect(props) {
const {isSelected, select} = useContentElementEditorState();
const {t} = useI18n({locale: 'ui'});
const [, drag, preview] = useDrag({
Method smil_definitions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def smil_definitions
return [] if skip_smil
smil_definition = {
type: 'playlist',
Function seekWithInvalidStateHandling
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const seekWithInvalidStateHandling = function(player) {
var originalSeek = player.seek;
player.seek = function(time) {
return retryOnProgress(function() {
Consider simplifying this complex logical expression. 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
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 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 BeforeAfter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function BeforeAfter(configuration) {
const {
isActive,
load,
before_label,
- 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 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 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 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 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 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"