Showing 137 of 237 total issues
Function Set
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Set(a){
if(a.isSet) return a;
var self;
var index = {};
self = [];
Function setup_event
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setup_event(){
// Subscribe_idに対応するイベント
ClickEvent.add('[subscribe_id]', function(){
var action = get_action(this);
var sid = this.getAttribute("subscribe_id");
Function toggle_clip
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function toggle_clip(id){
var body = _$("item_body_"+id);
var param = get_item_info(id);
var rate = subs_item(get_active_feed().subscribe_id).rate;
function fetch_clip(url,callback){
Function init
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init(){
app.load({}, function(){
LDR.setup_hook();
LDR.invoke_hook('BEFORE_INIT');
window.onerror = function(a,b,c){
Function subs_edit
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function subs_edit(e){
var el = this;
if(e){
Event.stop(e);
}
Model
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Subscribe.Model = Class.create().extend({
initialize: function(){
this.loaded = false;
return this;
},
Function make_filter
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function make_filter(){
var filters = [];
function add_filter(f){
filters.push(f);
}
Function setup_widgets
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setup_widgets(){
channel_widgets.sep = " | "
entry_widgets.sep = "";
entry_widgets.add('created_on', function(feed, item){
Method fetch_favicon!
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def fetch_favicon!
self.favicon ||= Favicon.new(feed: self)
favicon_list.each do |uri|
next unless response = URI.open(uri.to_s) rescue nil # ensure timeout
next if response.status.last.to_i >= 400
- 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 init
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
HotKey.prototype.init = function(){
var self = this;
var target = this._target;
var cancelNext;
var state = "";
- 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 subscribe_submit
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function subscribe_submit(e){
if(!this.history_back.checked) return;
var form = this;
var folder_id = this.folder_id.value;
Class Member
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Member < ActiveRecord::Base
# Virtual attribute for the unencrypted password
attr_accessor :password
serialize :config_dump
Function get_active_item
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_active_item(detail){
// return 1;
var sc = _$("right_container").scrollTop;
var divs = _$("right_body").getElementsByTagName("h2");
// for Opera9 beta
Function setup_widgets
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setup_widgets(){
channel_widgets.sep = " | "
entry_widgets.sep = "";
entry_widgets.add('created_on', function(feed, item){
Function Config
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
LDR.Config = (function(){
function Config(){
Object.extend(this, LDR.DefaultConfig);
this.onConfigChange = {};
}
Function pin_hover
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
pin_hover: function(e){
function stophide(){
if(app.state.pin_timer){ app.state.pin_timer.cancel() }
}
stophide();
Function Application
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.Application = (function(done){
function Application() {
this.initialized = false;
this.style_initializer = new LDR.StyleInitializer;
this.state = new LDR.StateClass;
Function toX
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
toX: function(text,to){
var nstr = [];
var temp,kana;
var skip = 0;
var latin = /[a-zA-Z.,-]/;
- 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 StyleInitializer
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
LDR.StyleInitializer = (function(){
function StyleInitializer(){
var that = this;
// self override
that.addRule = function(){
Function get_unread
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_unread(id,callback){
app.state.viewrange.start = 0;
app.state.has_next = true;
var api_url = '/api/unread';
function has_cache(){