Showing 88 of 611 total issues
File alert.spec.js
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
describe('alert', function() {
var bodyEl = $('body'), sandboxEl;
- Create a ticketCreate a ticket
Function postLink
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function postLink (scope, element, attr, controller) {
// Fixes firefox bug when using objects in model with typeahead
// Yes this breaks any other directive using a 'change' event on this input,
// but if it is using the 'change' event why is it used with typeahead?
- Create a ticketCreate a ticket
File tab.spec.js
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
describe('tab', function () {
var $compile, $templateCache, scope, sandboxEl;
- Create a ticketCreate a ticket
Function compile
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.compile = function (options) {
if (options.template && /\.html$/.test(options.template)) {
console.warn('Deprecated use of `template` option to pass a file. Please use the `templateUrl` option instead.');
options.templateUrl = options.template;
- Create a ticketCreate a ticket
Function postLink
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function postLink (scope, element, attr, controller) {
// Directive options
var options = {scope: scope, placeholder: defaults.placeholder};
angular.forEach(['template', 'templateUrl', 'controller', 'controllerAs', 'placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'placeholder', 'allNoneButtons', 'maxLength', 'maxLengthHtml', 'allText', 'noneText', 'iconCheckmark', 'autoClose', 'id', 'sort', 'caretHtml', 'prefixClass', 'prefixEvent', 'toggle'], function (key) {
- Create a ticketCreate a ticket
File collapse.spec.js
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
describe('collapse', function () {
var $compile, $templateCache, $animate, scope, sandboxEl;
- Create a ticketCreate a ticket
Function show
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$modal.show = function () {
if ($modal.$isShown) return;
var parent;
var after;
- Create a ticketCreate a ticket
Function executeDataBindingTests
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function executeDataBindingTests(bindingAttribute) {
it('should correctly apply model changes to the view', function() {
var elm = compileDirective('binding-' + bindingAttribute);
expect(sandboxEl.find('.nav-tabs > li.active').index()).toBe(scope.tab.active);
- Create a ticketCreate a ticket
Function bsCompilerService
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
function bsCompilerService ($q, $http, $injector, $compile, $controller, $templateCache) {
/*
* @ngdoc service
* @name $bsCompiler
- 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 $get
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.$get = function ($window, $rootScope, $tooltip, $timeout) {
var bodyEl = angular.element($window.document.body);
var matchesSelector = Element.prototype.matchesSelector || Element.prototype.webkitMatchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector;
- Create a ticketCreate a ticket
Function getCalculatedOffset
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getCalculatedOffset (placement, position, actualWidth, actualHeight) {
var offset;
var split = placement.split('-');
switch (split[0]) {
- Create a ticketCreate a ticket
File button.radio.spec.js
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
describe('bs-radio', function () {
var $compile, $q, $$rAF, scope, sandboxEl;
- Create a ticketCreate a ticket
File date-parser.js
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
angular.module('mgcrea.ngStrap.helpers.dateParser', [])
.provider('$dateParser', function ($localeProvider) {
- Create a ticketCreate a ticket
Function controller
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var controller = this.controller = function ($scope, $element, $attrs) {
var self = this;
// Attributes options
self.$options = angular.copy(defaults);
- Create a ticketCreate a ticket
Function DropdownFactory
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function DropdownFactory (element, config) {
var $dropdown = {};
// Common vars
- Create a ticketCreate a ticket
Function show
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$tooltip.show = function () {
if (!options.bsEnabled || $tooltip.$isShown) return;
scope.$emit(options.prefixEvent + '.show.before', $tooltip);
if (angular.isDefined(options.onBeforeShow) && angular.isFunction(options.onBeforeShow)) {
- Create a ticketCreate a ticket
Function compile
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
compile: function (tElement, tAttrs) {
// Support for inlined template (next sibling)
// It must be fetched before compilation
if (!tAttrs.bsDropdown) {
- Create a ticketCreate a ticket
Function $get
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.$get = function ($parse, $q) {
function ParseOptionsFactory (attr, config) {
var $parseOptions = {};
- Create a ticketCreate a ticket
Function $build
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$timepicker.$build = function () {
// console.warn('$timepicker.$build() viewDate=%o', viewDate);
var i;
var midIndex = scope.midIndex = parseInt(options.length / 2, 10);
var hours = [];
- Create a ticketCreate a ticket
Function ParseOptionsFactory
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ParseOptionsFactory (attr, config) {
var $parseOptions = {};
// Common vars
- Create a ticketCreate a ticket