Showing 120 of 355 total issues
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<Modal show={this.props.controls[1].show()}>
<Modal.Header closeButton>
<Modal.Title>Import Polygon</Modal.Title>
Function SingleLongTermAveragesGraph
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function SingleLongTermAveragesGraph(props) {
function getMetadata(timeOfYear) {
const metadataFromProps = _.pick(
props,
"ensemble_name",
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div id={"table"}>
<BootstrapTable
data={this.props.data}
Function createZippedShapefile
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createZippedShapefile(gj, options) {
// Alternate to function `zip` in `shp-write/src/zip`, but with option to
// store files in root of zipped shapefile.
//
// All behaviour is the same as the original function, with the exception
Function SingleTimeSeriesGraph
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function SingleTimeSeriesGraph(props) {
function getMetadata() {
const { model_id, experiment, variable_id, meta } = props;
const primaryVariableMetadata = _.find(meta, {
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<React.Fragment>
<Row>
<Col lg={6} md={6} sm={6}>
Function nameAPICallParametersFunction
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function nameAPICallParametersFunction(contexts) {
let variation = [];
const exemplarContext = contexts[0];
for (let context of contexts) {
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div className={styles.timeslider}>
<Slider
step={1}
Function getMetadata
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getMetadata() {
const {
model_id,
experiment,
variable_id,
Function assignColoursByGroup
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
function assignColoursByGroup(
graph,
segmentor,
colourList = category10Colours,
) {
- 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 constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(props) {
super(props);
this.state = {
run: undefined,
Function getMetadata
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getMetadata() {
const {
model_id,
experiment,
variable_id,
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
// TODO: Improve returned item
if (!_.allDefined(this.props, "model_id", "experiment", "variable_id")) {
return "Readying...";
}
Function loadGraph
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
loadGraph() {
// Fetch data for graph, then convert it to a graph spec and set state
// accordingly.
if (!shouldLoadData(this.props, this.displayNoDataMessage)) {
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
// TODO: Improve returned item
if (!_.allDefined(this.props, "model_id", "experiment", "variable_id")) {
return "Readying...";
}
Function getMetadata
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getMetadata(dataSpec) {
// Find and return metadata matching the data specification (`dataSpec`):
// model_id, experiment, variable_id, start_date, end_date, ensemble_member
// for monthly, seasonal and annual timescales.
// Variable, model, and experiment are supplied by the graph's parent, but
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div className={styles.selectorframe}>
<ControlLabel
className={
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const center = _.pick(this.props.origin, "lat", "lng");
return (
<Map
crs={this.props.crs}
Function getStats
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function getStats() {
return Promise.resolve({
data: {
foo: {
min: 0.06095475000006445,
Function createTimeseriesWorksheetSummaryCells
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var createTimeseriesWorksheetSummaryCells = function (metadata, dataSpec) {
var rows = [];
var header = [
"Model",
"Emissions Scenario",