aimer1124/JianshuSpider

View on GitHub
util/syncData.js

Summary

Maintainability
B
6 hrs
Test Coverage

Function articleInfo has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function articleInfo() {

    var articleTitles = [];
    // console.log('获取数据开始');
    getURL.getPageContent('/', function (err, gres, next) {
Severity: Major
Found in util/syncData.js - About 2 hrs to fix

    Function getCollections has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function getCollections() {
        var now = moment().format('x');
        var collectionsList = [];
        for (var i = 0; i <= 50; i++){
            collectionsList.push({
    Severity: Minor
    Found in util/syncData.js - About 2 hrs to fix

      Function fetchCollectionUrl has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var fetchCollectionUrl = function (collectionUrl, callback) {
              var delay = parseInt((Math.random() * 10000000) % 2000, 10);
              conCurrencyCount++;
      
              getURL.getPageContent(collectionUrl.url, function (err, res) {
      Severity: Minor
      Found in util/syncData.js - About 1 hr to fix

        Function fetchUrl has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    var fetchUrl = function (article, callback) {
                        var delay = parseInt((Math.random() * 10000000) % 2000, 10);
                        conCurrencyCount++;
                        // console.log('并发数:' + conCurrencyCount + ',访问的页面是:' + article.authorHref + ',控制的延迟:' + delay);
                        getURL.getPageContent(article.authorHref, function (err, res) {
        Severity: Minor
        Found in util/syncData.js - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status