sue445/chrome-gitlab-notifier

View on GitHub

Showing 10,177 of 10,177 total issues

Function send has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            send: function( headers, complete ) {
                var i,
                    xhr = options.xhr();

                xhr.open(
Severity: Major
Found in lib/jquery-3.2.1.js - About 3 hrs to fix

Function add has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    add: function( elem, types, handler, data, selector ) {

        var handleObjIn, eventHandle, tmp,
            events, t, handleObj,
            special, handlers, type, namespaces, origType,
Severity: Major
Found in lib/jquery-3.2.1.js - About 2 hrs to fix

Function matcherFromGroupMatchers has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
    var bySet = setMatchers.length > 0,
        byElement = elementMatchers.length > 0,
        superMatcher = function( seed, context, xml, results, outermost ) {
            var elem, j, matcher,
Severity: Major
Found in lib/jquery-3.2.1.js - About 2 hrs to fix

Function request has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        request: makeRequest(function(url, args, resolve, reject) {
            var method = args.method != null ? args.method.toUpperCase() : "GET"
            var body = args.body
            var assumeJSON = (args.serialize == null || args.serialize === JSON.serialize) && !(body instanceof $window.FormData)
            var responseType = args.responseType || (typeof args.extract === "function" ? "" : "json")
Severity: Major
Found in lib/mithril.js - About 2 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (typeof window !== "undefined") {
    if (typeof window.Promise === "undefined") {
        window.Promise = PromisePolyfill
    } else if (!window.Promise.prototype.finally) {
        window.Promise.prototype.finally = PromisePolyfill.prototype.finally
Severity: Major
Found in lib/mithril.js and 1 other location - About 2 hrs to fix
lib/mithril.js on lines 278..286

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 92.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

} else if (typeof global !== "undefined") {
    if (typeof global.Promise === "undefined") {
        global.Promise = PromisePolyfill
    } else if (!global.Promise.prototype.finally) {
        global.Promise.prototype.finally = PromisePolyfill.prototype.finally
Severity: Major
Found in lib/mithril.js and 1 other location - About 2 hrs to fix
lib/mithril.js on lines 271..286

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 92.

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

Further Reading

Function projects has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const projects = () => {
    if(!state.gitlab.projects) {
      return m("tr", [
        m("td[colspan='6']", [
          m(".progress", [
Severity: Major
Found in src/options.js - About 2 hrs to fix

Function resolve has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                    function resolve( depth, deferred, handler, special ) {
                        return function() {
                            var that = this,
                                args = arguments,
                                mightThrow = function() {
Severity: Major
Found in lib/jquery-3.2.1.js - About 2 hrs to fix

Function done has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function done( status, nativeStatusText, responses, headers ) {
            var isSuccess, success, error, response, modified,
                statusText = nativeStatusText;

            // Ignore repeat invocations
Severity: Major
Found in lib/jquery-3.2.1.js - About 2 hrs to fix

Consider simplifying this complex logical expression.
Open

                        if ( forward && useCache ) {

                            // Seek `elem` from a previously-cached index

                            // ...in a gzip-friendly way
Severity: Critical
Found in lib/jquery-3.2.1.js - About 2 hrs to fix

Function setMatcher has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
    if ( postFilter && !postFilter[ expando ] ) {
        postFilter = setMatcher( postFilter );
    }
    if ( postFinder && !postFinder[ expando ] ) {
Severity: Major
Found in lib/jquery-3.2.1.js - About 2 hrs to fix

Function superMatcher has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        superMatcher = function( seed, context, xml, results, outermost ) {
            var elem, j, matcher,
                matchedCount = 0,
                i = "0",
                unmatched = seed && [],
Severity: Major
Found in lib/jquery-3.2.1.js - About 2 hrs to fix

Function ajaxConvert has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ajaxConvert( s, response, jqXHR, isSuccess ) {
    var conv2, current, conv, tmp, prev,
        converters = {},

        // Work with a copy of dataTypes in case we need to modify it for conversion
Severity: Major
Found in lib/jquery-3.2.1.js - About 2 hrs to fix

Consider simplifying this complex logical expression.
Open

                    if (
                        // Skip if `onclick` prevented default
                        result1 !== false && !e.defaultPrevented &&
                        // Ignore everything but left clicks
                        (e.button === 0 || e.which === 0 || e.which === 1) &&
Severity: Critical
Found in lib/mithril.js - About 2 hrs to fix

Function domManip has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function domManip( collection, args, callback, ignored ) {

    // Flatten any nested arrays
    args = concat.apply( [], args );

Severity: Major
Found in lib/jquery-3.2.1.js - About 2 hrs to fix

File gitlab.js has 259 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class GitLab {
  constructor(args = {}) {
    // remove end of "/"
    const api_path = args.api_path || "";
    this.api_path = api_path.replace(/\/+$/, "");
Severity: Minor
Found in src/gitlab.js - About 2 hrs to fix

Function show has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Tooltip.prototype.show = function () {
    var e = $.Event('show.bs.' + this.type)

    if (this.hasContent() && this.enabled) {
      this.$element.trigger(e)
Severity: Major
Found in lib/bootstrap.js - About 2 hrs to fix

Function init has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    init = jQuery.fn.init = function( selector, context, root ) {
        var match, elem;

        // HANDLE: $(""), $(null), $(undefined), $(false)
        if ( !selector ) {
Severity: Major
Found in lib/jquery-3.2.1.js - About 2 hrs to fix

Function remove has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    remove: function( elem, types, handler, selector, mappedTypes ) {

        var j, origCount, tmp,
            events, t, handleObj,
            special, handlers, type, namespaces, origType,
Severity: Major
Found in lib/jquery-3.2.1.js - About 2 hrs to fix

Function resolveRoute has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function resolveRoute() {
            scheduled = false
            // Consider the pathname holistically. The prefix might even be invalid,
            // but that's not our problem.
            var prefix = $window.location.hash
Severity: Major
Found in lib/mithril.js - About 2 hrs to fix
Severity
Category
Status
Source
Language