docs/js/angular-bootstrap-prettify.js
Function ngEmbedApp
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function($templateCache, $browser, docsRootScope, $location, $sniffer, $animate, $exceptionHandler) {
return {
terminal: true,
link: function(scope, element, attrs) {
var modules = ['ngAnimate'],
File angular-bootstrap-prettify.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
var directive = {};
var service = { value: {} };
Function link
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function(scope, element, attrs) {
var modules = ['ngAnimate'],
embedRootScope,
deregisterEmbedRootScope;
Function reindentCode
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
service.reindentCode = function() {
return function (text, spaces) {
if (!text) return text;
var lines = text.split(/\r?\n/);
var prefix = ' '.substr(0, spaces || 0);
- 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 jsFiddle
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
directive.jsFiddle = function(getEmbeddedTemplate, escape, script) {
return {
terminal: true,
link: function(scope, element, attr) {
var name = '',
Function link
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function(scope, element, attr) {
var name = '',
stylesheet = '<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">\n',
fields = {
html: '',
Function ngEmbedApp
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function($templateCache, $browser, docsRootScope, $location, $sniffer, $animate, $exceptionHandler) {
Function templateMerge
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
service.templateMerge = ['reindentCode', function(indentCode) {
return function(template, properties) {
return template.replace(/\{\{(\w+)(?:\:(\d+))?\}\}/g, function(_, key, indent) {
var value = properties[key];
- 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"