Showing 425 of 1,055 total issues
Method make
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def make
source = @file
filename = [@basename, '.webp'].join
destination = Paperclip::TempfileFactory.new.generate(filename)
- 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
Avoid too many return
statements within this function. Open
Open
return state;
Avoid too many return
statements within this function. Open
Open
return {
...state,
points,
potentialPoint: null,
indicatorPosition: ensureInPolygon(points, state.indicatorPosition)
Avoid too many return
statements within this function. Open
Open
return {
...state,
potentialPointInsertIndex: index,
potentialPoint
};
Avoid too many return
statements within this function. Open
Open
return state;
Avoid too many return
statements within this function. Open
Open
return {
...state,
indicatorPosition: ensureInPolygon(state.points, state.indicatorPosition)
};
Avoid too many return
statements within this function. Open
Open
return state;
Avoid too many return
statements within this function. Open
Open
return () => {
if (shouldPlay && mediaMuted) {
if (configuration.rewindOnUnmute && lastControlledVia === 'autoplay') {
playerActions.seekTo(0);
}
Avoid too many return
statements within this function. Open
Open
return motifAreaDimension.top + motifAreaDimension.height
Avoid too many return
statements within this function. Open
Open
return -1;
Avoid too many return
statements within this function. Open
Open
return 1;
Avoid too many return
statements within this function. Open
Open
return 0;
Avoid too many return
statements within this function. Open
Open
return 0;
Avoid too many return
statements within this function. Open
Open
return result;
Avoid too many return
statements within this function. Open
Open
return 'Der Server ist nicht erreichbar.';
Avoid too many return
statements within this function. Open
Open
return 'Der Server hat einen internen Fehler gemeldet.';
Avoid too many return
statements within this function. Open
Open
return [
{
type: 'video/mp4',
src: videoFile.urls[quality]
}
Avoid too many return
statements within this function. Open
Open
return motifAreaDimension.height
Avoid too many return
statements within this function. Open
Open
return '';
Avoid too many return
statements within this function. Open
Open
return Promise.resolve('failed');