Showing 19 of 98 total issues
Function link
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function ($scope, $element) {
var updateContent = function () {
if ($scope.dontUpdate) return;
$scope.$root.safeApply(function () {
$scope.content = $element.html();
File startup.js
has 497 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var GIVE_UP_DELAY = 30000;
(function () {
var deferred = Q.defer();
File postView.js
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
angular.module("mnd-web.pages")
.factory("firstLevelHtmlParser", [function () {
var parse = function (html) {
var div = document.createElement("div");
Function _update
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this._update = function () {
var self = this;
//Reset the calendar
self.weeks = [];
// Build the calendar object
Function link
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function ($scope, $element) {
///////////
// Setup //
///////////
Function link
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function ($scope, $element) {
// AmazonS3Config
var amazonS3Config = $scope.$root.Configurations.reactiveQuery({name: "amazonS3"}).result[0];
Function link
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function ($scope) {
$scope.availableActions = Object.keys(AppMethods);
$scope.menu = {
// Move functions
moveUp: function (index, event) {
Function link
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function ($scope, $element, $attrs) {
$scope.type = $attrs.type;
$scope.getTitle = function () {
Function link
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function ($scope) {
$scope.delTag = function (index) {
var removedTags = $scope.tags.splice(index, 1);
if ($scope.onRemove()) {
$scope.onRemove()(removedTags[0]);
Function setSeoTags
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var setSeoTags = function (values) {
// Description
var descriptionNodesSelector = [
"#meta-description",
Function onFileSelect
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.onFileSelect = function (files) {
var file = files[0];
if (
$scope.fileType &&
!new RegExp($scope.fileType).test(file.type)
Function save
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.save = function () {
// Menu configuration
menuConfig = angular.copy($scope.menuConfig);
delete menuConfig._id;
Function link
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function ($scope, $element){
// Save the size as number
var size = parseInt($scope.size, 10);
// Get acceptable border sizes
var borderSize = size / 20;
Function controller
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
controller: ["$scope", function ($scope) {
Ceres.subscribe("myCoins");
var Coins = Ceres.getCollection("coins");
var today = moment().utc().startOf("day").valueOf();
var coinsRQ = Coins.reactiveQuery({
Function link
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function ($scope) {
$scope.form = $scope.form || {};
$scope.form.fields = $scope.form.fields || [];
$scope.addField = function () {
Function addTag
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.addTag = function (e) {
if (e && e.type === "keyup") {
if ($scope.addingKeyCodes.indexOf(e.keyCode) === -1) {
return;
}
Function getHolidays
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.getHolidays = function (country) {
var selectedCountry = $scope.selected.country || country;
var selectedYear = $scope.selected.year;
Function link
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function ($scope) {
$scope.permissions = $scope.permissions || {};
$scope.permissions.members = $scope.permissions.members || [];
$scope.member = {};
Function bind
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
/* */ Function.prototype.bind = function (oThis) {
/* */ if (typeof this !== "function") {
/* */ throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
/* */ }
/* */ var aArgs = Array.prototype.slice.call(arguments, 1);
- 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"