nelsonic/arana

View on GitHub

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);
Severity: Major
Found in lib/tasker.js - About 2 hrs to fix

    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);
    Severity: Minor
    Found in lib/tasker.js - About 2 hrs to fix

    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',
    Severity: Minor
    Found in lib/recorder.js - About 1 hr to fix

      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 = {
      Severity: Minor
      Found in lib/recorder.js - About 1 hr to fix

        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,
        Severity: Minor
        Found in lib/recorder.js - About 1 hr to fix

          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
          
          
          Severity: Minor
          Found in lib/recorder.js - About 1 hr to fix

            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){
            Severity: Minor
            Found in lib/worker.js - About 1 hr to fix

              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
              
              
              Severity: Minor
              Found in lib/recorder.js - About 55 mins to fix

              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','');
              Severity: Minor
              Found in lib/url_transform.js - About 45 mins to fix

              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);
              Severity: Major
              Found in lib/recorder.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return add_labels(data, callback);
                Severity: Major
                Found in lib/recorder.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return add_milestones(data, callback);
                  Severity: Major
                  Found in lib/recorder.js - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language