Showing 1,197 of 2,136 total issues
Function render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render () {
const resourceName = this.props.resourceName;
const license = this.props.license_info;
const credits = this.props.credits;
- 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 renderTimeRequired
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
renderTimeRequired () {
const resource = this.props.resource;
const timeRequired = resource.material_type === "Activity"
? "45 Minutes"
: resource.material_type === "Investigation"
- 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 query
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
query (_params: any, _fieldName?: any) {
const params = jQuery.extend({}, _params); // clone
if (_fieldName) {
this.setState({ [`waitingFor_${_fieldName}`]: true });
params.load_only = _fieldName;
- 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 TextInputWithAsyncValidationSupport
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const TextInputWithAsyncValidationSupport = (props: any) => {
const { asyncValidation, asyncValidationError, validations, ...innerProps } = props;
const [asyncValidationPassed, setAsyncValidationPassed] = useState(true);
// eslint-disable-next-line react-hooks/exhaustive-deps
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render () {
const providerComponents = [];
if (enableAuthProviders && this.props.oauthProviders) {
const providers = this.props.oauthProviders;
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render () {
const { type, placeholder, disabled, name } = this.props;
let className = "text-input " + this.props.name;
if (this.props.showRequired && !this.props.isPristine) {
- 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
return newToken( Type.OPERATOR, firstChar );
Avoid too many return
statements within this function. Open
return newToken( this.unitTypes[ match[0].toLowerCase() ] || Type.DIMEN, val );
Avoid too many return
statements within this function. Open
return newToken( Type.URL, match[2] || match[3] || match[4] || '' );
Avoid too many return
statements within this function. Open
return failure();
Avoid too many return
statements within this function. Open
return newToken( Type.IDENT, val );
Avoid too many return
statements within this function. Open
return newToken( Type.COLOR, this.css.substring( ch, this.ch ) );
Avoid too many return
statements within this function. Open
return newToken( Type.FUNCTION, val );
Avoid too many return
statements within this function. Open
return newToken( Type.PERCENT, val + '%' );
Avoid too many return
statements within this function. Open
return newToken( Type.CHARACTER, firstChar );
Avoid too many return
statements within this function. Open
return newToken( Type.NUMBER, val );
Avoid too many return
statements within this function. Open
return newToken( Type.COLOR, val );
Avoid too many return
statements within this function. Open
return select( selector.replace( rtrim, "$1" ), context, results, seed );
Avoid too many return
statements within this function. Open
return value;
Avoid too many return
statements within this function. Open
return results;