Showing 66 of 97 total issues
File scholar.py
has 851 lines of code (exceeds 250 allowed). Consider refactoring. Open
#! /usr/bin/env python
"""
This module provides classes for querying Google Scholar and parsing
returned results. It currently *only* processes the first results
page. It is not a recursive crawler.
File rails.validations.js
has 634 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Client Side Validations - v5.0.0 (https://github.com/DavyJonesLocker/client_side_validations)
* Copyright (c) 2016 Geremia Taglialatela, Brian Cardarella
* Licensed under MIT (http://opensource.org/licenses/mit-license.php)
File jquery.raty.js
has 574 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* jQuery Raty - A Star Rating Plugin
*
* The MIT License
*
Method submit
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def submit(job_name, boxes, conns)
job_id = SecureRandom.uuid
job = Job.new id: job_id, user_id: @user_id, name: job_name
result = {
- 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 main
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def main():
usage = """scholar.py [options] <query string>
A command-line interface to Google Scholar.
Examples:
- 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 _parse_article
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def _parse_article(self, div):
self.article = ScholarArticle()
for tag in div:
if not hasattr(tag, 'name'):
- 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 submit
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
def submit(job_name, boxes, conns)
job_id = SecureRandom.uuid
job = Job.new id: job_id, user_id: @user_id, name: job_name
result = {
Function _parse_links
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def _parse_links(self, span):
for tag in span:
if not hasattr(tag, 'name'):
continue
if tag.name != 'a' or tag.get('href') is None:
- 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 _parse_article
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def _parse_article(self, div):
self.article = ScholarArticle()
for tag in div:
if not hasattr(tag, 'name'):
- 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 input
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
input: function(input) {
var $form, $input, binding, event, form, ref;
$input = $(input);
form = input.form;
$form = $(form);
Method filetree
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def filetree
dir = params[:dir]
if !dir.blank?
username = dir.split(':')[0][1..-1]
path = dir.split(':')[1..-1].join('/')
- 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 rating_for
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rating_for(rateable_obj, dimension=nil, options={})
cached_average = rateable_obj.average dimension
avg = cached_average ? cached_average.avg : 0
Class ToolsController
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class ToolsController < ApplicationController
before_action :authenticate_user!, except: [:index, :search, :show]
def index
Method read
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def read(path, offset, len)
File.open(path) do |file|
offset ||= 0
len ||= 10.kilobytes
content = ''
- 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 show
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def show
if params[:user_id]
user = User.find_by_username params[:user_id]
not_found unless user
@pipeline = Pipeline.find_by_owner_id_and_slug user.id, params['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
Class DatastoreController
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class DatastoreController < ApplicationController
LIBRARY_ID = '__dataset__library__'
before_action :authenticate_user!, except: [:filetree, :show, :shared, :download]
Function uniqueness
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
uniqueness: function(element, options) {
var data, key, message, name, ref, scope_value, scoped_element, scoped_name;
message = ClientSideValidations.validators.local.presence(element, options);
if (message) {
if (options.allow_blank === true) {
Method rating_for_user
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rating_for_user(rateable_obj, rating_user, dimension = nil, options = {})
@object = rateable_obj
@user = rating_user
@rating = Rate.find_by_rater_id_and_rateable_id_and_dimension(@user.id, @object.id, dimension)
stars = @rating ? @rating.stars : 0
Method show
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def show
unless params[:uid] or current_user
redirect_to new_user_session_path
return
end
- 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 _parse_article
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _parse_article(self, div):
self.article = ScholarArticle()
for tag in div:
if not hasattr(tag, 'name'):
- 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"