Your add-on contains minified, concatenated or otherwise machine-generated code. If you haven't done so, you need to provide the original sources, together with instructions on how to generate the exact same code used in the add-on

  • js/HolidayCalendar.js line 7-14
    var extend = function (o, c) {
		if (o && c && typeof c == "object") {
			for (var p in c) {
				o[p] = c[p];
			}
		}
		return o;
	};
  • js/index.js line 211-239
    function setList(weeks, year) {
        list.innerHTML = "";
        for (var i = 0; i < weeks.length; i++) {
            var week = weeks[i];
            var tds = [];
            for (var k = 0; k < week.length; k++) {
                var d = new Date(week[k]);
                if (k == 0 && d.getDay() > 0) {
                    // 补位
                    var firstDay = d.getDay();  // 第一天
                    for (var m = 0; m < firstDay; m++) {
                        var pcd = new Date(d.getFullYear(), d.getMonth(), d.getDate() - firstDay + m);
                        _setDayInfo(tds, pcd, year, 'disabled');
                    }
                }
                _setDayInfo(tds, d, year, null);
            }
            if (tds.length < 7) {
                var dd = new Date(week[week.length - 1]);   // 最后一天
                var len = 7 - tds.length;
                for (var k = 0; k < len; k++) {
                    var lcd = new Date(dd.getFullYear(), dd.getMonth(), dd.getDate() + k + 1);
                    _setDayInfo(tds, lcd, year, 'disabled')
                }
            }
            // list.append('<div class="table">' + tds.join('') + '</div>');
            list.innerHTML = list.innerHTML + '<div class="table">' + tds.join('') + '</div>';
        }
    }

The above is the non-compliant code.
Where is the problem? That is the original code.
github url:https://github.com/x2009again/HolidayCalendar

NOTE: When pasting code here, place triple backticks characters " ` " on the line above and below the code to activate a code-formatting.

Regarding the problem - the code you pasted looks like re-formatted minified code. As you can see, all variable names are reduced to single letter - a common result of a minification process.

So for reviewer it’s much harder to tell what the code is doing…

function (o, c) {  // what is "o" and what is "c"???
  if (o && c && typeof c == “object”) {
1 Like

ok,thank you.
I will modify the parameter name.