Showing 29 of 29 total issues
File node.d.ts
has 1672 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Type definitions for Node.js v4.x
// Project: http://nodejs.org/
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
File angular.d.ts
has 721 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Type definitions for Angular JS 1.4+
// Project: http://angularjs.org
// Definitions by: Diego Vilar <http://github.com/diegovilar>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
File jquery.d.ts
has 594 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Type definitions for jQuery 1.10.x / 2.0.x
// Project: http://jquery.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Christian Hoffmeister <https://github.com/choffmeister>, Steve Fenton <https://github.com/Steve-Fenton>, Diullei Gomes <https://github.com/Diullei>, Tass Iliopoulos <https://github.com/tasoili>, Jason Swearingen <https://github.com/jasons-novaleaf>, Sean Hill <https://github.com/seanski>, Guus Goossens <https://github.com/Guuz>, Kelly Summerlin <https://github.com/ksummerlin>, Basarat Ali Syed <https://github.com/basarat>, Nicholas Wolverson <https://github.com/nwolverson>, Derek Cicerone <https://github.com/derekcicerone>, Andrew Gaspar <https://github.com/AndrewGaspar>, James Harrison Fisher <https://github.com/jameshfisher>, Seikichi Kondo <https://github.com/seikichi>, Benjamin Jackman <https://github.com/benjaminjackman>, Poul Sorensen <https://github.com/s093294>, Josh Strobl <https://github.com/JoshStrobl>, John Reilly <https://github.com/johnnyreilly/>, Dick van den Brink <https://github.com/DickvdBrink>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
Function stiPagination
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
function stiPagination(stiPaginationConfig) {
return {
restrict: 'EA',
require: '^stTable',
scope: {
- 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
File jasmine.d.ts
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Type definitions for Jasmine 2.2
// Project: http://jasmine.github.io/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Theodore Brown <https://github.com/theodorejb>, David Pärsson <https://github.com/davidparsson/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
Function stiPagination
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
function stiPagination(stiPaginationConfig) {
return {
restrict: 'EA',
require: '^stTable',
scope: {
Function link
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function link(scope, element, attrs, ctrl) {
scope.itemsPerPage = scope.itemsPerPage ? scope.itemsPerPage : stiPaginationConfig.itemsPerPage;
scope.maxSize = scope.maxSize ? scope.maxSize : stiPaginationConfig.maxSize;
scope.autoHide = angular.isDefined(scope.autoHide) ? scope.autoHide : false;
Function StiTableController
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function StiTableController($scope) {
let ctrl = this;
$scope.$stiSelected = {};
$scope.$stiNumSelected = 0;
Function stiTable
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function stiTable($parse) {
return {
restrict: 'A',
require: ['stTable', 'stiTable'],
scope: true,
Function stiTable
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function stiTable($parse) {
return {
restrict: 'A',
require: ['stTable', 'stiTable'],
scope: true,
- 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 stiSelectAll
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function stiSelectAll() {
return {
restrict: 'A',
require: [
'^stiTable',
Function writeTemplates
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function writeTemplates() {
return new Promise(function (resolve, reject) {
glob('template/**/*.html', function (err, files) {
if (err) {
reject(err);
Function link
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function link(scope, element, attrs, ctrls) {
let [stTableCtrl, stiTableCtrl] = ctrls;
scope.$stiRowIdField = angular.isDefined(attrs.rowIdField) ? attrs.rowIdField : '$$hashKey';
if (attrs.trackSelectedMode === 'all') {
Similar blocks of code found in 2 locations. Consider refactoring. Open
scope.directionLinks = angular.isDefined(attrs.directionLinks) ? scope.$parent.$eval(attrs.directionLinks) : true;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 45.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid too many return
statements within this function. Open
return i;
Avoid too many return
statements within this function. Open
return i;
Similar blocks of code found in 2 locations. Consider refactoring. Open
scope.boundaryLinks = angular.isDefined(attrs.boundaryLinks) ? scope.$parent.$eval(attrs.boundaryLinks) : false;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 45.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function StiTableController
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function StiTableController($scope) {
let ctrl = this;
$scope.$stiSelected = {};
$scope.$stiNumSelected = 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
Parsing error: 'import' and 'export' may appear only with 'sourceType: module' Open
import * as angular from 'angular';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Parsing error: 'import' and 'export' may appear only with 'sourceType: module' Open
import './sti-modules';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/