Showing 98 of 221 total issues
Function removeFromArticle
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Slideshow.prototype.removeFromArticle = function(number, language) {
var slideshow = this,
deferred = $q.defer(),
linkHeader;
Function postLink
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function postLink(scope, $element, attrs) {
var baseOffsetY = 125, // base offset (without from height)
initialOffsetY, // initial offset at pane load
firstAdjustment = true,
$formBox,
Function decorate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.decorate = function (image) {
/**
* @class image
*/
Function activate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Tab.prototype.activate = function (element, container, callback) {
var $active = container.find('> .active')
var transition = callback
&& $.support.transition
&& $active.hasClass('fade')
Function removeFromArticle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ArticlesList.prototype.removeFromArticle = function(
number,
language,
articlesList) {
var deferred = $q.defer(),
Function addToArticle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Snippet.prototype.addToArticle = function (number, language) {
var snippet = this,
deferred = $q.defer(),
linkHeader;
Function removeFromArticle
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Snippet.prototype.removeFromArticle = function(number, language) {
var snippet = this,
deferred = $q.defer(),
linkHeader;
Function addAuthorToArticle
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.addAuthorToArticle = function () {
// NOTE: An author can be added multiple times (with different
// roles), therefore we need multiple deep copies of the object to
// distinguish between them in $scope.authors ng-repeat.
var author = angular.copy($scope.newAuthor),
Function removeFromArticle
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NcImage.prototype.removeFromArticle = function(articleId, language) {
var self = this,
deferred = $q.defer(),
linkHeader;
Function updateDescription
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NcImage.prototype.updateDescription = function (newDesc) {
var deferredPatch = $q.defer(),
params,
self = this,
url;
Function searchArticles
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Article.prototype.searchArticles = function (query, filters) {
var allArticles = [],
deferredGet = $q.defer(),
params = {},
url;
Function changeCommentingSetting
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Article.prototype.changeCommentingSetting = function (newValue) {
var deferred = $q.defer(),
postData = {
article: {}
},
Function query
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.query = function (filter) {
self.searchFilter = filter;
// not so pretty, but it's the fastest way to clear an Array
while(self.displayed.length > 0) {
Function create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Topic.create = function (title, parentId, language) {
var deferredPost = $q.defer(),
requestData = {topic: {}},
url;
Consider simplifying this complex logical expression. Open
Open
if (autoPlace) {
var $parent = this.$element.parent()
var orgPlacement = placement
var docScroll = document.documentElement.scrollTop || document.body.scrollTop
Function exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
- 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
Avoid too many return
statements within this function. Open
Open
return this
Function Dragdata
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
function Dragdata($log) {
this.converters = {
'test': function ($e) {
return {};
},
- 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"