Showing 7 of 19 total issues
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var icon = 'fa fa-' + this.props.icon;
var content;
if (!this.state.loaded) {
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var icon = 'fa fa-' + this.props.icon;
var content;
if (!this.state.loaded) {
Method remote_tracks
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def remote_tracks(id)
tracks = []
params = { limit: 200, offset: 0 }
path = path_for(id)
- 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
Method remote_tracks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def remote_tracks(id)
tracks = []
params = { limit: 200, offset: 0 }
path = path_for(id)
Method ensure_track
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def ensure_track(spotify_playlist, track)
track.queries.each do |query|
search_tracks = @api.search(:track, query)["tracks"]["items"]
# puts query.inspect
- 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
Method call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def call(params)
auth = compute_auth(params.env["omniauth.auth"])
# Do not allow users w/o email
if !auth.email && !(auth.user_id || user_signed_in)
- 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
Method compute_auth
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compute_auth(omniauth)
auth = AuthRepository.by_external(
omniauth[:provider], omniauth[:uid].to_s
) || Auth.new(
provider: omniauth[:provider],
- 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"