Showing 12 of 18 total issues
Function tasker
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function tasker (data) {
if(!data.url) { // short circuit if no url is set
return [];
}
var uri = URL.parse(data.url);
Function tasker
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function tasker (data) {
if(!data.url) { // short circuit if no url is set
return [];
}
var uri = URL.parse(data.url);
- 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 add_people
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function add_people(data, method, callback) {
data = url_transform(data, method);
var record = {
id: aguid(data.url),
index: 'github',
Function add_issues
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function add_issues(data, callback){
// console.log('ISSUES URL: '+ data.url)
data = url_transform(data); // url of the repo
console.log('add_issues URL transformed to: ' + data.url + " > "+aguid(data.url));
var record = {
Function add_repos
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function add_repos(data, callback){
data = url_transform(data);
var record = {
id: aguid(data.url),
url: data.url,
Function save_record_to_elasticsearch
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function save_record_to_elasticsearch (data, callback) {
// console.log(" - - - - - - - - - - - - - - - URL:")
// console.log(data.url);
// if the page scraped was a followers page
Function run
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function run (callback) {
// fetch the next task from the work queue
wq.next(function(err, task) {
// console.log(task);
gs(task.split(' ')[0], function(gserr, data){
Function save_record_to_elasticsearch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function save_record_to_elasticsearch (data, callback) {
// console.log(" - - - - - - - - - - - - - - - URL:")
// console.log(data.url);
// if the page scraped was a followers page
- 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 url_transform
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function url_transform(data, method) {
// console.log("Transforming >> " +data.url)
var uri = url.parse(data.url);
if(uri.path.match(/tab=repositories/)) { // personal repositories
var username = uri.path.replace('?tab=repositories','');
- 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
Avoid too many return
statements within this function. Open
return add_issues(data, callback);
Avoid too many return
statements within this function. Open
return add_labels(data, callback);
Avoid too many return
statements within this function. Open
return add_milestones(data, callback);