Showing 17 of 88 total issues
File threatmodelcontroller_spec.js
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict'
require('jasmine');
describe('threat model controller tests', function () {
Function datacontext
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function datacontext($q, $http, common, threatmodellocator) {
var threatModel = null;
var threatModelLocation = null;
Function getRoutes
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getRoutes() {
return [
{
url: '/',
config: {
Function github
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function github($q, $routeParams, $location, common, datacontext) {
// Using 'Controller As' syntax, so we assign this to the vm variable (for viewmodel).
/*jshint validthis: true */
var vm = this;
var controllerId = 'github';
File routes.config_spec.js
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
var jasmine = require('jasmine');
var mockery = require('mockery');
var request = require('supertest');
File github_spec.js
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
//require('angular-mocks');
describe('github controller', function () {
File threatmodelrepository_spec.js
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
require('jasmine');
var mockery = require('mockery');
var moduleUnderTest = '../../td/repositories/threatmodelrepository';
Function github
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
function github($q, $routeParams, $location, common, datacontext) {
// Using 'Controller As' syntax, so we assign this to the vm variable (for viewmodel).
/*jshint validthis: true */
var vm = this;
var controllerId = 'github';
- 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 webreport
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function webreport($timeout, $routeParams, common, datacontext, threatmodellocator) {
// Using 'Controller As' syntax, so we assign this to the vm variable (for viewmodel).
/*jshint validthis: true */
var vm = this;
var controllerId = 'webreport';
Function exports
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Function datacontext
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
function datacontext($q, $http, common, threatmodellocator) {
var threatModel = null;
var threatModelLocation = null;
- 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 threatmodellocator
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function threatmodellocator() {
var service = {
getModelLocation: getModelLocation,
getModelPath: getModelPath,
Function updateContents
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
updateContents: function (path, message, content, sha, branch, cb) {
Function webreport
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function webreport($timeout, $routeParams, common, datacontext, threatmodellocator) {
Function github
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function github($q, $routeParams, $location, common, datacontext) {
Function deleteContents
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
deleteContents: function (path, message, sha, branch, cb) {
Function createContents
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
createContents: function (path, message, content, branch, cb) {