Showing 208 of 10,177 total issues
Function onload
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.onload = function() {
chrome.notifications.onClicked.addListener((notification_id) => {
// close notification popup
chrome.notifications.clear(notification_id, () => {
// open gitlab event page (Issue, MergeRequest, Milestone)
- Create a ticketCreate a ticket
Function handlers
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handlers: function( event, handlers ) {
var i, handleObj, sel, matchedHandlers, matchedSelectors,
handlerQueue = [],
delegateCount = handlers.delegateCount,
cur = event.target;
- Create a ticketCreate a ticket
Function setOffset
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setOffset: function( elem, options, i ) {
var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
position = jQuery.css( elem, "position" ),
curElem = jQuery( elem ),
props = {};
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
Open
if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
// Trust units reported by jQuery.css
unit = unit || initialInUnit[ 3 ];
- Create a ticketCreate a ticket
Function notify
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
notify(args){
const project = args.project;
const project_event = args.project_event;
const internal = args.internal;
const current_time = args.current_time;
- Create a ticketCreate a ticket
Function showHide
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function showHide( elements, show ) {
var display, elem,
values = [],
index = 0,
length = elements.length;
- Create a ticketCreate a ticket
Function parseQueryString
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var parseQueryString = function(string) {
if (string === "" || string == null) return {}
if (string.charAt(0) === "?") string = string.slice(1)
var entries = string.split("&"), counters = {}, data0 = {}
for (var i = 0; i < entries.length; i++) {
- Create a ticketCreate a ticket
Function onload
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.onload = function() {
// remove notification count when show popup
// because) can not use both chrome.browserAction.onClicked and popup
// https://developer.chrome.com/extensions/browserAction.html#event-onClicked
chrome.browserAction.setBadgeText({text: ""});
- Create a ticketCreate a ticket
Function view
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
app.view = function(vnode) {
const state = vnode.state;
const matchSearchKey = (project) => {
const keys = state.search_key.split(" ");
- Read upRead up
- Create a ticketCreate a ticket
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
Function applyPlacement
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Tooltip.prototype.applyPlacement = function (offset, placement) {
var $tip = this.tip()
var width = $tip[0].offsetWidth
var height = $tip[0].offsetHeight
- Create a ticketCreate a ticket
Function load
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.fn.load = function( url, params, callback ) {
var selector, type, response,
self = this,
off = url.indexOf( " " );
- Create a ticketCreate a ticket
Function projList
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const projList = () => {
if(!state.gitlab.projects) {
return m("li.active", [
m(".progress", [
m(".progress-bar.progress-bar-striped.active[aria-valuemax='100'][aria-valuemin='0'][aria-valuenow='100'][role='progressbar']", {style: {"width": "100%"}}, [
- Create a ticketCreate a ticket
Function loadProjectsBase
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
loadProjectsBase(page, all_projects) {
const params = {
page: page,
per_page: this.per_page,
order_by: "name",
- Create a ticketCreate a ticket
Function loop
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function loop(i) {
// 0 = init
// 1 = scheduled
// 2 = done
for (; i < compiled.length; i++) {
- Create a ticketCreate a ticket
Function removeClass
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
removeClass: function( value ) {
var classes, elem, cur, curValue, clazz, j, finalValue,
i = 0;
if ( jQuery.isFunction( value ) ) {
- Create a ticketCreate a ticket
Function speed
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.speed = function( speed, easing, fn ) {
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
complete: fn || !fn && easing ||
jQuery.isFunction( speed ) && speed,
duration: speed,
- Create a ticketCreate a ticket
Function show
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Tab.prototype.show = function () {
var $this = this.element
var $ul = $this.closest('ul:not(.dropdown-menu)')
var selector = $this.data('target')
- Create a ticketCreate a ticket
Function onreadystatechange
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
xhr.onreadystatechange = function(ev) {
// Don't throw errors on xhr.abort().
if (aborted) return
if (ev.target.readyState === 4) {
try {
- Create a ticketCreate a ticket
Function getGitLabVersion
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getGitLabVersion() {
// Metadata API
// GET /metadata
// https://docs.gitlab.com/ee/api/metadata.html (for GitLab 15.5+)
return m.request({
- Create a ticketCreate a ticket
Function attr
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
attr: function( elem, name, value ) {
var ret, hooks,
nType = elem.nodeType;
// Don't get/set attributes on text, comment and attribute nodes
- Create a ticketCreate a ticket