Showing 27 of 27 total issues
Function timeHistogram
has 228 lines of code (exceeds 25 allowed). Consider refactoring. Open
function timeHistogram($rootScope, HeatMapSourceGenerator,
searchFilter, DateTimeService, NumberService) {
var directive = {
templateUrl: 'components/histogram/histogram.tpl.html',
restrict: 'EA',
File Map.js
has 537 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*eslint angular/di: [2,"array"]*/
/*eslint angular/document-service: 2*/
/*eslint max-len: [2,100]*/
/**
* Map service
Function link
has 219 lines of code (exceeds 25 allowed). Consider refactoring. Open
function link(scope, element, attr) {
var HistogramBars;
var vm = scope;
vm.barId = attr.barid;
Function exports
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-contrib-watch');
Function keywordInput
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
function keywordInput(HeatMapSourceGenerator, searchFilter, $window, filterKeywordService) {
return {
link: keywordInputLink,
restrict: 'EA',
Function keywordInputLink
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
function keywordInputLink(scope) {
var vm = scope;
var numberKeywords = vm.numberKeywords || 5;
vm.filter = searchFilter;
Function datePickerFilterLink
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
function datePickerFilterLink(scope) {
var vm = scope;
vm.dateOptions = searchFilter;
Function buildMapLayers
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildMapLayers(layerConfig) {
var layer,
layers = [];
if (angular.isArray(layerConfig)) {
Function createHeatMapSource
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createHeatMapSource(hmParams) {
var counts_ints2D = hmParams.counts_ints2D,
gridLevel = hmParams.gridLevel,
gridColumns = hmParams.columns,
gridRows = hmParams.rows,
Function init
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
service.init = function(config) {
var viewConfig = angular.extend(defaults.view,
config.mapConfig.view),
rendererConfig = config.mapConfig.renderer ?
config.mapConfig.renderer : defaults.renderer,
Function makeHistogram
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeHistogram(histogram) {
var barsheight = 54;
var histogrambarsWidth = 350;
var paddingBar = 8;
Function tweetlist
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tweetlist(Map, HeightModule, PanelInformationService) {
var MapService = Map;
return {
link: tweetlistLink,
restrict: 'EA',
Function exports
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function ( config ) {
config.set({
basePath: '.',
files: [
'assets/lib/angular/angular.min.js',
Similar blocks of code found in 2 locations. Consider refactoring. Open
function openStartDate() {
vm.startDate.opened = true;
vm.dateOptions.minDate = vm.initialDateOptions.minDate;
vm.dateOptions.maxDate = vm.datepickerEndDate;
}
- 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 69.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
function openEndDate() {
vm.endDate.opened = true;
vm.dateOptions.maxDate = vm.initialDateOptions.maxDate;
vm.dateOptions.minDate = vm.datepickerStartDate;
}
- 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 69.
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 compactInteger
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function compactInteger(input, decimals) {
decimals = decimals || 0;
decimals = Math.max(decimals, 0);
var number = parseInt(input, 10);
var signString = number < 0 ? '-' : '';
Function tweetlistLink
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tweetlistLink(scope) {
var vm = scope;
vm.tweetList = [];
vm.tweetList.exist = false;
Function modalLink
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function modalLink(scope) {
var vm = scope;
var MapService = Map;
vm.closestTweets = [];
vm.coordinate = [];
Function setupEvents
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.setupEvents = function() {
MapService.getMap().getView().on('change:center', function(evt){
mapIsMoved = !mapIsMoved ? true : false;
});
MapService.getMap().getView()
Function getCurrentExtent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
service.getCurrentExtent = function(){
var viewProj = service.getMapProjection(),
extent = service.getMapView().calculateExtent(service.getMapSize()),
extentWgs84 = ol.proj.transformExtent(extent, viewProj, 'EPSG:4326'),
transformInteractionLayer = service.