Showing 188 of 188 total issues
Function timeDriver
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function timeDriver(sink: any): any {
let time = 0;
const frameCallbacks: Array<any> = [];
const scheduler = makeScheduler();
Function intent
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function intent(domSource, timeSource) {
const UP_KEYCODE = 38
const DOWN_KEYCODE = 40
const ENTER_KEYCODE = 13
const TAB_KEYCODE = 9
Similar blocks of code found in 2 locations. Consider refactoring. Open
const changeColorReducer$ = action$
.filter(a => a.type === 'CHANGE_COLOR')
.map(action => function changeColorReducer(oldState) {
return {color: action.payload, width: oldState.width};
});
- 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
const changeWidthReducer$ = action$
.filter(a => a.type === 'CHANGE_WIDTH')
.map(action => function changeWidthReducer(oldState) {
return {color: oldState.color, width: action.payload};
});
- 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
export function makeHashHistoryDriver(
options?: HashHistoryOptions
): HistoryDriver {
const history = createHashHistory(options);
return function hashHistoryDriver(sink$: Stream<HistoryInput | string>) {
- 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
export function makeServerHistoryDriver(
options?: MemoryHistoryOptions
): HistoryDriver {
const history = createMemoryHistory(options);
return function serverHistoryDriver(sink$: Stream<HistoryInput | string>) {
- 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 renderNodeLabel
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderNodeLabel(node: StreamGraphNode, zap: Zap | null, style: string): VNode {
let label = '';
if (zap) {
// MUTATION!
if (Array.isArray(zap.value)) {
Function reducers
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function reducers(actions) {
const moveHighlightReducer$ = actions.moveHighlight$
.map(delta => function moveHighlightReducer(state) {
const suggestions = state.get('suggestions')
const wrapAround = x => (x + suggestions.length) % suggestions.length
Function makeThrottleAnimation
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeThrottleAnimation(
timeSource: any,
schedule: any,
currentTime: () => number
) {
Function makeDiagram
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeDiagram(
schedule: any,
currentTime: () => number,
interval: number,
setMaxTime: any
Function renderCommonNode
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderCommonNode(node: StreamGraphNode, zaps: Array<Zap>): VNode {
const index = zaps.map(zap => zap.id).indexOf(node.id);
const zap = index === -1 ? null : zaps[index];
return svg.g([
Function setupNonBubblingListener
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private setupNonBubblingListener(
input: NonBubblingMeta
): void {
const [_, eventType, elementFinder, destination] = input;
if (!this.origin) {
Function diagram
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function diagram(diagramString: string, values = {}): Stream<any> {
const characters = diagramString.split('');
const stream = xs.create();
function valueFor(character: string) {
if (character in values) {
Function throttleAnimation
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function throttleAnimation<T>(inputStream: Stream<T>): Stream<T> {
const source = timeSource();
const stream = xs.fromObservable(inputStream);
let animationListener: any = null;
Function replicateMany
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function replicateMany<Si extends any>(
sinks: Si,
sinkProxies: SinkProxies<Si>
): DisposeFunction {
const scheduleMicrotask = quicktask();
Function _n
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public _n(inst: InternalInstances<Si>): void {
this.inst = inst;
const arrSinks = inst.arr;
const ils = this.ils;
const out = this.out;
Function makePeriodic
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makePeriodic(createOperator: () => OperatorArgs<any>) {
const {schedule, currentTime} = createOperator();
return function periodic(period: number): Stream<number> {
let stopped = false;
Function makeClickListener
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeClickListener(push: (p: string) => void) {
return function clickListener(event: MouseEvent) {
if (which(event) !== 1) {
return;
}
Function runUpdateChangelogs
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runUpdateChangelogs() {
packagesWithChangelog
.filter(function (package) {
if (typeof argPackage === 'string' && argPackage.length > 0) {
return argPackage === package;
Function main
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function main(sources: Sources): Sinks {
const firstName$ = sources.DOM
.select('.first')
.events('input')
.map(ev => (ev.target as HTMLInputElement).value)