sue445/chrome-gitlab-notifier

View on GitHub

Showing 10,177 of 10,177 total issues

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

  const matchSearchKey = (project) => {
    const keys = state.search_key.split(" ");
    return keys.every((key) => {
      const r = new RegExp(key, "i");
      return project.path_with_namespace.match(r);
Severity: Major
Found in src/trigger.js and 1 other location - About 2 hrs to fix
src/options.js on lines 11..17

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

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

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

  const matchSearchKey = (project) => {
    const keys = state.search_key.split(" ");
    return keys.every((key) => {
      const r = new RegExp(key, "i");
      return project.path_with_namespace.match(r);
Severity: Major
Found in src/options.js and 1 other location - About 2 hrs to fix
src/trigger.js on lines 11..17

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

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 buildFragment has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function buildFragment( elems, context, scripts, selection, ignored ) {
    var elem, tmp, tag, wrap, contains, j,
        fragment = context.createDocumentFragment(),
        nodes = [],
        i = 0,
Severity: Major
Found in lib/jquery-3.2.1.js - About 2 hrs to fix

Consider simplifying this complex logical expression.
Open

                if ( ( mappedTypes || origType === handleObj.origType ) &&
                    ( !handler || handler.guid === handleObj.guid ) &&
                    ( !tmp || tmp.test( handleObj.namespace ) ) &&
                    ( !selector || selector === handleObj.selector ||
                        selector === "**" && handleObj.selector ) ) {
Severity: Critical
Found in lib/jquery-3.2.1.js - About 2 hrs to fix

Function addCombinator has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function addCombinator( matcher, combinator, base ) {
    var dir = combinator.dir,
        skip = combinator.next,
        key = skip || dir,
        checkNonElements = base && key === "parentNode",
Severity: Minor
Found in lib/jquery-3.2.1.js - About 1 hr to fix

Function matcherFromTokens has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function matcherFromTokens( tokens ) {
    var checkContext, matcher, j,
        len = tokens.length,
        leadingRelative = Expr.relative[ tokens[0].type ],
        implicitRelative = leadingRelative || Expr.relative[" "],
Severity: Minor
Found in lib/jquery-3.2.1.js - About 1 hr to fix

Function select has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

select = Sizzle.select = function( selector, context, results, seed ) {
    var i, tokens, token, type, find,
        compiled = typeof selector === "function" && selector,
        match = !seed && tokenize( (selector = compiled.selector || selector) );

Severity: Minor
Found in lib/jquery-3.2.1.js - About 1 hr to fix

Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
    var matched, match, tokens, type,
        soFar, groups, preFilters,
        cached = tokenCache[ selector + " " ];

Severity: Minor
Found in lib/jquery-3.2.1.js - About 1 hr to fix

Function val has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    val: function( value ) {
        var hooks, ret, isFunction,
            elem = this[ 0 ];

        if ( !arguments.length ) {
Severity: Minor
Found in lib/jquery-3.2.1.js - About 1 hr to fix

Function slide has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Carousel.prototype.slide = function (type, next) {
    var $active   = this.$element.find('.item.active')
    var $next     = next || this.getItemForDirection(type, $active)
    var isCycling = this.interval
    var direction = type == 'next' ? 'left' : 'right'
Severity: Minor
Found in lib/bootstrap.js - About 1 hr to fix

Function data has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    data: function( key, value ) {
        var i, name, data,
            elem = this[ 0 ],
            attrs = elem && elem.attributes;

Severity: Minor
Found in lib/jquery-3.2.1.js - About 1 hr to fix

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

  $(window).on('load', function () {
    $('[data-ride="carousel"]').each(function () {
      var $carousel = $(this)
      Plugin.call($carousel, $carousel.data())
    })
Severity: Major
Found in lib/bootstrap.js and 1 other location - About 1 hr to fix
lib/bootstrap.js on lines 2051..2056

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

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

  $(window).on('load.bs.scrollspy.data-api', function () {
    $('[data-spy="scroll"]').each(function () {
      var $spy = $(this)
      Plugin.call($spy, $spy.data())
    })
Severity: Major
Found in lib/bootstrap.js and 1 other location - About 1 hr to fix
lib/bootstrap.js on lines 529..534

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

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 onload has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.onload = function() {
  m.mount(document.getElementById("app"), {
    oninit: function() {
      const config = new Config(localStorage);

Severity: Minor
Found in src/trigger_init.js - About 1 hr to fix

Function getEventInternalId has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  getEventInternalId(args){
    // Single issue
    // GET GET /projects/:id/issues/:issue_iid
    // https://docs.gitlab.com/ee/api/issues.html#single-project-issue
    //   or
Severity: Minor
Found in src/gitlab.js - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

        else if (
            hasPropertyKey(vnode3, key, ns)
            && key !== "className"
            && !(key === "value" && (
                vnode3.tag === "option"
Severity: Critical
Found in lib/mithril.js - About 1 hr to fix

Function style has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    style: function( elem, name, value, extra ) {

        // Don't set styles on text and comment nodes
        if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
            return;
Severity: Minor
Found in lib/jquery-3.2.1.js - About 1 hr to fix

Function stop has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    stop: function( type, clearQueue, gotoEnd ) {
        var stopQueue = function( hooks ) {
            var stop = hooks.stop;
            delete hooks.stop;
            stop( gotoEnd );
Severity: Minor
Found in lib/jquery-3.2.1.js - About 1 hr to fix

Function access has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
    var i = 0,
        len = elems.length,
        bulk = key == null;

Severity: Minor
Found in lib/jquery-3.2.1.js - About 1 hr to fix

Function extend has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

jQuery.extend = jQuery.fn.extend = function() {
    var options, name, src, copy, copyIsArray, clone,
        target = arguments[ 0 ] || {},
        i = 1,
        length = arguments.length,
Severity: Minor
Found in lib/jquery-3.2.1.js - About 1 hr to fix
Severity
Category
Status
Source
Language