Showing 64 of 270 total issues
Function componentDidMount
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
async componentDidMount() {
const moments = await fetch(`${config.apiEntry}/api/moments/random`);
const momentJson = await moments.json();
let momentId = fromJS(momentJson.id);
const momentMedia = fromJS(momentJson.media);
Function googleAnalytics
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function googleAnalytics(store) {
const gaMomentEventCategory = "Moment";
const gaPlayTimeEventAction = "playTime";
const gaPlayTimeEventIntervalInMilliseconds = 5000;
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
// const {
// loading,
// currentStory,
// currentStoryId,
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const mission = this.props.match?.params?.mission;
const channels = this.state.selectedChannels;
const {loading, data, tapeId, minBlock, maxBlock} = this.state;
if (!channels || (data && Object.keys(data).lengh === 0)) {
Function componentDidUpdate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentDidUpdate() {
const transcripts = this.state.transcripts;
// DOM for timeline
// only need this when transcripts are displayed
if (
Function formSpeakers
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function formSpeakers(data) {
if (typeof data == "undefined") {
return [];
}
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const classes = classNames("timeline-container", "panel", "panel-default");
return (
<div className="col-md-6">
<div style={{ position: "relative", width: "100%", height: "100%" }}>
Function renderSearchResults
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderSearchResults = () => {
const { loading, searching, moments } = this.state;
if (loading && searching) {
return (
Function renderCards
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderCards() {
// const {landmarks} = this.props;
let landmarks = []; //TEMPORARY UNTIL WE GET LANDMARKS SORTED OUT :)
const moments = this.props.story.momentList;
const cards = _.sortBy(moments.concat(landmarks), "met_start");
Function formInteractions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function formInteractions(data) {
if (typeof data == "undefined") {
return [];
}
Function componentDidUpdate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
componentDidUpdate() {
let parent = ReactDOM.findDOMNode(this).children[2].children[1].children[0];
console.log(parent);
let timeline;
let scrollHeight = 0;
- 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 BlockSelectMenu
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const BlockSelectMenu = (props) => {
const { handleValueChange, blockIndex, minBlock, maxBlock } = props;
var blockIndexArr = [];
for (var i = minBlock; i <= maxBlock; i++) {
Function componentDidUpdate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentDidUpdate() {
let parent = ReactDOM.findDOMNode(this).children[2].children[1].children[0];
console.log(parent);
let timeline;
let scrollHeight = 0;
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className="app-container">
<AppHeader />
<h1 className="center">
Function render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { onEnd, autoplay } = this.props;
let loading = this.state.loading;
let transcripts = this.state.transcript;
- 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 getTranscriptsTrs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async function getTranscriptsTrs(url) {
var rawTranscriber;
var transcripts = [];
await fetch(url)
.then((response) => {
- 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 getActiveIndex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function getActiveIndex(transcripts, currentMissionTime) {
if (
transcripts == null ||
transcripts.length < 1 ||
currentMissionTime == 0
- 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 getActiveIndex
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function getActiveIndex(transcripts, currentMissionTime) {
if (
transcripts == null ||
transcripts.length < 1 ||
currentMissionTime == 0
- 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 renderSearchResults = () => {
const { loading, searching, moments } = this.state;
if (loading && searching) {
- 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 timelineClickEvent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
timelineClickEvent(startTime) {
//tolerance is to prevent number comparisons from being incorrect due to the very last decimal
//because if the startTime and this.state.audio.time are not "equal" then the code will
//create an infinite loop which will crash the momentViewer. We only experienced this issue on
//moment 5 for some reason, and adding a tolerance was the simplest way to fix it after
- 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"