Showing 8 of 77 total issues
Function h2h
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
let h2h = () => {
let teamClasses = (attr, direction) => {
let teamValue = stats.stats[attr];
let oppValue = h2hStats.stats[attr];
let classes;
- Create a ticketCreate a ticket
Function TeamHeadToHead
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
const TeamHeadToHead = ({stats, teams, onTeamSelect, h2hStats, h2hMatches}) => {
const teamId = stats.team.id;
let h2h = () => {
let teamClasses = (attr, direction) => {
- Read upRead up
- Create a ticketCreate a ticket
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 _getTeamStats
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
let _getTeamStats = (teamId) => {
let extractCurrentStreak = (form) => {
let match = form.match(/^W+/)
if (match) {
return { wins: match[0].length };
- Create a ticketCreate a ticket
Function exports
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config) {
config.set({
browsers: [process.env.TRAVIS ? 'Firefox' : 'Chrome'],
files: [
{ pattern: 'tests.webpack.js', watched: false }
- Create a ticketCreate a ticket
Function h2hMatchesBody
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
let h2hMatchesBody = () => {
let body;
if (h2hMatches.length) {
let matches = h2hMatches;
let won = _.filter(matches, (m) => m.team1_id === teamId ? m.team1_score > m.team2_score : m.team2_score > m.team1_score).length;
- Create a ticketCreate a ticket
Function exports
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function() {
return Promise.map([{ name: 'Michel Platini' }, { name: 'Zinedine Zidane' }, { name: 'Gianluigi Buffon' }, { name: 'Paolo Maldini' },
{ name: 'Pele' }, { name: 'Ronaldo' }, { name: 'Franz Beckenbauer'}, { name: 'Oliver Kahn' }, { name: 'No Matches'}], (attrs) => {
return Player.createWithEigenTeam(attrs);
}).then((players) => {
- Create a ticketCreate a ticket
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const stats = this.props.stats;
if (!stats) {
return (<div>Loading...</div>);
}
- Create a ticketCreate a ticket
Function verifyMatch
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
const verifyMatch = function(match, matchType, team1, team2, winner, done) {
- Create a ticketCreate a ticket