Showing 172 of 172 total issues
Method create_ability_file
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_ability_file
ability_code = [
"# Generator social_stream:install has modified this file. Please,", #0
"# check everything is working ok, specially if the former `Ability`", #1
"# class inherited from another class or included another module", #2
Function Object
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
SocialStream.Object = (function(SS, $, undefined){
var callback = new SS.Callback(),
pIcon = '<i class="icon_tool16-private"></i>';
- 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 RelationCustom
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
SocialStream.RelationCustom = (function(SS, $, undefined){
var callback = new SS.Callback();
var getListEl = function() {
return $('.relation_list');
- 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 do_request
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def do_request(api_url, params, token=nil)
url = URI.parse(@api_url + api_url)
if not params.empty?
req = Net::HTTP::Post.new(url.path)
- 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 Explore
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
SocialStream.Explore = (function(SS, $, undefined){
var callback = new SS.Callback();
var headerPushState = function() {
$('#explore-header div').on('shown', function(e) {
- 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 method_missing
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def method_missing(method, *args, &block)
super
rescue NameError => subtype_error
raise subtype_error unless _delegate_to_supertype?(:method)
- 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 authenticator
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def authenticator
Rack::OAuth2::Server::Token.new do |req, res|
client = Site::Client.find(req.client_id) || req.invalid_client!
client.secret == req.client_secret || req.invalid_client!
- 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 change
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def change
create_table "geotags", :force => true do |t|
t.integer "activity_object_id"
t.integer "address_id"
Method generateRSAKeys
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generateRSAKeys(keysPath)
unless File.directory?(keysPath)
return "Keys path not exists"
end
Function Event
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
SocialStream.Event = (function(SS, $, undefined) {
var callback = new SS.Callback();
var color = function(){
return SS.Events.current.eventColor;
Function Repository
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
SocialStream.Repository = (function(SS, $, undefined){
var callback = new SS.Callback();
var initFilter = function() {
$('.repository .loading').hide();
Similar blocks of code found in 2 locations. Consider refactoring. Open
case "video-youtube":
var youtubeLink = buildYoutubeVideoLink("http://" + url);
var subwords = splitFirst(word,url)
return parseWord(subwords[0]) + youtubeLink + parseWord(subwords[1])
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 58.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
case "image":
var imageLink = buildImageLink("http://" + url);
var subwords = splitFirst(word,url)
return parseWord(subwords[0]) + imageLink + parseWord(subwords[1])
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 58.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
$(document).on("mouseleave", ".unfollow-button", function(){
$(this).hide();
$(this).siblings(".following-button").show();
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 58.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
$(document).on("mouseenter",".following-button", function(){
$(this).hide();
$(this).siblings(".unfollow-button").show();
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 58.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method do_request
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def do_request(api_url, params, token=nil)
url = URI.parse(@api_url + api_url)
if not params.empty?
req = Net::HTTP::Post.new(url.path)
Function initFullCalendar
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var initFullCalendar = function() {
var calendar = getCalendarEl();
var options = {
header: {
Function _setOption
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setOption: function(option, value) {
if(value != null){
switch(option) {
case "hidden":
if(value) {
Method destroy
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def destroy
@conversation.move_to_trash(@actor)
respond_to do |format|
- 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 STORE
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
PRESENCE.STORE = (function(P,$,undefined){
var init = function(){ }
var storePassword = function() {
- 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"