sue445/chrome-gitlab-notifier

View on GitHub

Showing 10,177 of 10,177 total issues

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

  function Plugin(option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.popover')
      var options = typeof option == 'object' && option
Severity: Major
Found in lib/bootstrap.js and 1 other location - About 5 hrs to fix
lib/bootstrap.js on lines 1750..1760

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

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

app.view = function(vnode) {
  const state = vnode.state;

  const current_time = new Date();
  const action_labels = {
Severity: Major
Found in src/popup.js - About 5 hrs to fix

Function defaultPrefilter has 122 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function defaultPrefilter( elem, props, opts ) {
    var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
        isBox = "width" in props || "height" in props,
        anim = this,
        orig = {},
Severity: Major
Found in lib/jquery-3.2.1.js - About 4 hrs to fix

Function Callbacks has 121 lines of code (exceeds 25 allowed). Consider refactoring.
Open

jQuery.Callbacks = function( options ) {

    // Convert options from String-formatted to Object-formatted if needed
    // (we check in cache first)
    options = typeof options === "string" ?
Severity: Major
Found in lib/jquery-3.2.1.js - About 4 hrs to fix

Function updateNodes has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function updateNodes(parent, old, vnodes, hooks, nextSibling, ns) {
        if (old === vnodes || old == null && vnodes == null) return
        else if (old == null || old.length === 0) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)
        else if (vnodes == null || vnodes.length === 0) removeNodes(parent, old, 0, old.length)
        else {
Severity: Major
Found in lib/mithril.js - About 4 hrs to fix

Function route has 110 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function route(root, defaultRoute, routes) {
        if (root == null) throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined")
        // 0 = start0
        // 1 = init
        // 2 = ready
Severity: Major
Found in lib/mithril.js - About 4 hrs to fix

Config has 33 functions (exceeds 20 allowed). Consider refactoring.
Open

class Config {
  constructor(storage){
    this.storage = storage || {};
  }

Severity: Minor
Found in src/config.js - About 4 hrs to fix

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

  function Plugin(option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.affix')
      var options = typeof option == 'object' && option
Severity: Major
Found in lib/bootstrap.js and 1 other location - About 4 hrs to fix
lib/bootstrap.js on lines 2022..2031

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

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

  function Plugin(option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.scrollspy')
      var options = typeof option == 'object' && option
Severity: Major
Found in lib/bootstrap.js and 1 other location - About 4 hrs to fix
lib/bootstrap.js on lines 2334..2343

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

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

                then: function( onFulfilled, onRejected, onProgress ) {
                    var maxDepth = 0;
                    function resolve( depth, deferred, handler, special ) {
                        return function() {
                            var that = this,
Severity: Major
Found in lib/jquery-3.2.1.js - About 4 hrs to fix

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

      this.saveConfig = function (state, projects, userId) {
        config.save({
          gitlabPath:           state.gitlab_path,
          apiPath:              state.api_path,
          privateToken:         state.private_token,
Severity: Major
Found in src/options_init.js and 1 other location - About 3 hrs to fix
src/trigger_init.js on lines 28..41

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

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

      this.saveConfig = function (state, projects, userId) {
        config.save({
          gitlabPath:           state.gitlab_path,
          apiPath:              state.api_path,
          privateToken:         state.private_token,
Severity: Major
Found in src/trigger_init.js and 1 other location - About 3 hrs to fix
src/options_init.js on lines 24..37

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

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

function Animation( elem, properties, options ) {
    var result,
        stopped,
        index = 0,
        length = Animation.prefilters.length,
Severity: Major
Found in lib/jquery-3.2.1.js - About 3 hrs to fix

File options.js has 316 lines of code (exceeds 250 allowed). Consider refactoring.
Open

try {
  var m = require("mithril");
} catch (e){
}

Severity: Minor
Found in src/options.js - About 3 hrs to fix

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

  function Plugin(option) {
    return this.each(function () {
      var $this = $(this)
      var data  = $this.data('bs.dropdown')

Severity: Major
Found in lib/bootstrap.js and 1 other location - About 3 hrs to fix
lib/bootstrap.js on lines 142..150

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

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

  function Plugin(option) {
    return this.each(function () {
      var $this = $(this)
      var data  = $this.data('bs.alert')

Severity: Major
Found in lib/bootstrap.js and 1 other location - About 3 hrs to fix
lib/bootstrap.js on lines 880..888

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

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

    trigger: function( event, data, elem, onlyHandlers ) {

        var i, cur, tmp, bubbleType, ontype, handle, special,
            eventPath = [ elem || document ],
            type = hasOwn.call( event, "type" ) ? event.type : event,
Severity: Major
Found in lib/jquery-3.2.1.js - About 3 hrs to fix

Function Sizzle has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Sizzle( selector, context, results, seed ) {
    var m, i, elem, nid, match, groups, newSelector,
        newContext = context && context.ownerDocument,

        // nodeType defaults to 9, since context defaults to document
Severity: Major
Found in lib/jquery-3.2.1.js - About 3 hrs to fix

Function CHILD has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        "CHILD": function( type, what, argument, first, last ) {
            var simple = type.slice( 0, 3 ) !== "nth",
                forward = type.slice( -4 ) !== "last",
                ofType = what === "of-type";

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

Function notifyProjectEvent has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

  notifyProjectEvent(project_id, project_event){
    const target_type = project_event.target_type || "Commit";

    let comment_target_type;
    if((target_type == "Note" || target_type == "DiffNote" ) && project_event.action_name == "commented on"){
Severity: Minor
Found in src/background.js - About 3 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

Severity
Category
Status
Source
Language