Showing 98 of 221 total issues
Function updateRole
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Author.prototype.updateRole = function (params) {
var headersParam,
linkHeader,
promise,
url;
Function circularBufferFactory
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
function circularBufferFactory() {
/**
* Creates a new circular buffer instance.
*
* @method create
- Read upRead up
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 create
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Snippet.create = function (name, templateId, fields) {
var deferredPost = $q.defer(),
requestData;
requestData = {
Function query
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NcImage.query = function (page, itemsPerPage, searchFilter) {
var deferredGet = $q.defer(),
requestOptions,
results = [],
url;
Function getAllByPage
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.getAllByPage = function (page) {
var deferredGet = $q.defer(),
url;
var totalPerPage = itemsPerPage * latestPage;
Function circularBufferFactory
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function circularBufferFactory() {
/**
* Creates a new circular buffer instance.
*
* @method create
Function confirmUnassignArticlesList
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.confirmUnassignArticlesList = function (articlesList) {
var modal,
title,
text;
Function confirmUnassignRelatedArticle
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.confirmUnassignRelatedArticle = function (relatedArticle) {
var modal,
title,
text;
Function confirmRemoveAuthor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.confirmRemoveAuthor = function (author) {
var modal,
title,
text;
Function applyPlacement
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Tooltip.prototype.applyPlacement = function(offset, placement) {
var replace
var $tip = this.tip()
var width = $tip[0].offsetWidth
var height = $tip[0].offsetHeight
Function create
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.create = function (opt) {
if (!('size' in opt)) {
throw new Error(
'a circular buffer needs an integer size option');
}
Function updateButtonsMode
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateButtonsMode() {
var editables,
blocks,
selection = $window.getSelection(),
testRange,
Function addToArticle
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Topic.addToArticle = function (articleId, language, topics) {
var deferred = $q.defer(),
linkHeader = [];
if (topics.length < 1) {
Function ModalCtrl
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ModalCtrl($modalInstance, $sce, info, $rootScope) {
var self = this,
url;
switch(info.action) {
Function add
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.add = function (parameters) {
var deferred = $q.defer(),
url;
url = Routing.generate(
Function ModalCtrl
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ModalCtrl($modalInstance, $sce, info, $rootScope) {
var self = this,
url;
switch(info.action) {
Function setOrderOfRelatedArticles
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function (relatedArticle, index) {
var self = this,
defered = $q.defer(),
linkHeader = [];
Function confirmDeleteComments
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.confirmDeleteComments = function (commentId) {
var commentIdGiven = (typeof commentId !== 'undefined'),
modal,
title,
text;
Function authorRoleChanged
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.authorRoleChanged = function (newRole, oldRole, author) {
author.updatingRole = true;
author.updateRole({
number: article.articleId,
Function show
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
var startEvent = $.Event('show.bs.collapse')
this.$element.trigger(startEvent)